|
However, "never take a benchmark at face value", on constant input values GCC makes all sorts of weird optimizations.
"In testa che avete, Signor di Ceprano?"
-- Rigoletto
|
|
|
|
|
I agree. In grad school, we wrote a lot of PL/I code.
IBM's top of the line optimizing compiler at the time.
Our professor (BTW an Italian from Argentina), gave us projects to "play" with the optimizer.
Long time ago. The technology is much more advanced today.
"A little time, a little trouble, your better day"
Badfinger
|
|
|
|
|
I made my own tests...
And I have to admit the non-indexed code is impressively faster than the indexed one (clocks):
non-indexed 288299
indexed 426617
(one million or randomly-sized, random strings).
Now I'm 'wondering which of the buggers to blame'.
"In testa che avete, Signor di Ceprano?"
-- Rigoletto
|
|
|
|
|
I guess he means the operator precedence here surprised him!
|
|
|
|
|
|
And...
What did you expect?
"In testa che avete, Signor di Ceprano?"
-- Rigoletto
|
|
|
|
|
... a compilation error 
|
|
|
|
|
int Inquisition = 3;
cout<< "The Spanish" + Inquisition;
I fixed up the code to make it clearer. Iβm sure that you werenβt expecting that either!π€ͺ
If you can't laugh at yourself - ask me and I will do it for you.
|
|
|
|
|
|
int value= 3;
cout << value + "ABCDEF";
|
|
|
|
|
This is legal C, but a real coding horror. The only place this should appear is in an obfuscated C contest entry.
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|
|
Looks like even The Lounge is not appropriate place for posting such code...
Thank you for valuable information, I will do my best to avoid such terrible code in the future.
|
|
|
|
|
int value = 3;
cout << &value["ABCDEF"];
|
|
|
|
|
Coding horrors all of them
Life should not be a journey to the grave with the intention of arriving safely in a pretty and well-preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming βWow! What a Ride!" - Hunter S Thompson - RIP
|
|
|
|
|
Nice. And without & it prints D.
|
|
|
|
|
#Worldle #310 1/6 (100%)
π©π©π©π©π©π
https://worldle.teuteuf.fr
too easy
"A little time, a little trouble, your better day"
Badfinger
|
|
|
|
|
#Worldle #310 1/6 (100%)
π©π©π©π©π©π
https://worldle.teuteuf.fr
Easy indeed.
|
|
|
|
|
"A little time, a little trouble, your better day"
Badfinger
|
|
|
|
|
#Worldle #310 1/6 (100%)
π©π©π©π©π©π
https://worldle.teuteuf.fr
Yes, that one was easy.
|
|
|
|
|
#Worldle #309 3/6 (100%)
π©π©π©π©β¬βοΈ
π©π©π©π©π¨β‘οΈ
π©π©π©π©π©π
https://worldle.teuteuf.fr
I had no idea until I checked
One should play this game to learn about the shape of the world.
"A little time, a little trouble, your better day"
Badfinger
|
|
|
|
|
Wordle 526 5/6
β¬β¬π¨β¬β¬
π¨β¬β¬β¬β¬
β¬π©β¬β¬π©
π¨π©β¬β¬π©
π©π©π©π©π©
|
|
|
|
|
Wordle 526 5/6
β¬β¬β¬β¬β¬
β¬🟩β¬β¬🟩
β¬🟩β¬β¬🟩
β¬🟩β¬β¬🟩
🟩🟩🟩🟩🟩
All green
"If we don't change direction, we'll end up where we're going"
|
|
|
|
|
Wordle 526 4/6
π¨β¬β¬β¬β¬
β¬π©β¬β¬β¬
β¬π©β¬β¬π©
π©π©π©π©π©
|
|
|
|
|
Wordle 526 4/6
π¨β¬β¬β¬β¬
β¬β¬β¬β¬π¨
β¬β¬β¬β¬π©
π©π©π©π©π©
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
|
|
|
|
|
Wordle 526 4/6
β¬β¬π¨β¬β¬
β¬β¬β¬β¬β¬
β¬π©β¬β¬π©
π©π©π©π©π©
|
|
|
|