Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Fakerlol855yYep, did a similar rant few days back, but the impact of -O is just magic.
I mean if you check the assembly code produced with -O0, you'd see that almost every line of code actually accesses the memory even for the most mundane things. That slows down your programs by a friggin lot.
One more reason why I can't part with C/++ <3 -
C++ is not my l;anguage, but I found this page :
http://ridiculousfish.com/blog/...
(I was looking for something else, but this is even better lol).
BTW, Even Java/.Net compilers are insane in optimization -
@NoToJavaScript I had a class on parallel programming and we used Java for practical examples. At one point someone complained that His Code ran waaaaay slower than anyone elses and it took a while for us to figure Out that He hast optimization disabled. Slower by a Factor of around 10 If I remember correctly
-
@NickyBones No, it was a university project sonwe had to get every library confirmed by our supervisors,
I got one kd tree library accepted the rest was plain C++ -
@NoToJavaScript Wow, that recursion fix up is really neat. As well as the built in call fix.
All hail the GCC! I am so glad at my current job we have standardized on gcc and mingw
Related Rants
Had to wirte and optimize a C++ program that finds for 1000x1000x1000 grid points the 100 nearest points for each (with an additional factor to make it more complicated).
It had to run in under 18 minutes to pass. No matter what I did I couldn't get it fast enough. I tried kd-trees, caching of certain points, optimizing distamce calculations by ommiting any irrelevant factor, saving points' calculated squares etc etc. When Ibwas down to 20 minutes, I realized, that my makefile had an error and ignored the - O3 flag...
Well, it actually ran 5 minutes with -O3.
rant
wk191