Speed Optimization of C++ console application
-
@kshegunov I wrote absolutely nothing about "-g". I still maintain that simple -O0 vs -O2 is NOT going to divide performance by a factor of 10. I cannot begin to imagine how badly a person would have to design their algorithm to validate that level of performance hit. something other than compiler optimization is causing his hit...
@Kent-Dorfman said in Speed Optimization of C++ console application:
@kshegunov I wrote absolutely nothing about "-g".
Fair enough.
I still maintain that simple -O0 vs -O2 is NOT going to divide performance by a factor of 10. I cannot begin to imagine how badly a person would have to design their algorithm to validate that level of performance hit.
https://bitbucket.org/kshegunov/ans-utilities/src/master/hermite/
Knock yourself out, if you so desire. I'm certainly not investing the time to see if
-g
makes a significant difference, which I strongly suspect it doesn't. -
@kshegunov I wrote absolutely nothing about "-g". I still maintain that simple -O0 vs -O2 is NOT going to divide performance by a factor of 10. I cannot begin to imagine how badly a person would have to design their algorithm to validate that level of performance hit. something other than compiler optimization is causing his hit...
@Kent-Dorfman said in Speed Optimization of C++ console application:
@kshegunov I wrote absolutely nothing about "-g". I still maintain that simple -O0 vs -O2 is NOT going to divide performance by a factor of 10. I cannot begin to imagine how badly a person would have to design their algorithm to validate that level of performance hit. something other than compiler optimization is causing his hit...
That strongly depends on the algorightm, I'd say.
Just imagine, a non optimized build that does not fit in the cache, so the CPU has to re-load stuff from memory all the time vs. the optimized build that runs fluently.
Factor 10 is probably not the normal case where you have to wait for I/O anyway, but for heavy computing it is easily possible.
Regards
-
wrote on 18 Dec 2019, 15:20 last edited by
This is starting to sound like a coding challenge. Can you write an algorithm that is slow the compiler can optimize and make fast? Like turning lead to gold.
-
This is starting to sound like a coding challenge. Can you write an algorithm that is slow the compiler can optimize and make fast? Like turning lead to gold.
@fcarney said in Speed Optimization of C++ console application:
Can you write an algorithm that is slow the compiler can optimize and make fast? Like turning lead to gold.
As I wrote, any template nonsense you have (the deeper and nastier the better) fits into this category.
-
wrote on 19 Dec 2019, 22:53 last edited by
Eh, the OP kind of disappeared so I guess it isn't that important to him. I'm more interested in knowing whether the windoze version in this exercise was compiled to CLR bytecode, which he never answered, and which IMHO invalidates any real comparison.
21/25