3 ms·
> And why do you need to know the kind of assembly being generated? How much smarter than the compiler are you? The compilers are actually quite stupid in the
by sharpneli 11y ago
> And why do you need to know the kind of assembly being generated? How much smarter than the compiler are you?
The compilers are actually quite stupid in the end. One has to know what kind of constructs the compiler can work well with and then change the problematic code to such that the compiler can produce efficient code out of.
This step comes after the profiler has pointed out the problematic spot.
Personally I find C++ code written in the modern style far more difficult to optimize than one that's closer to C. And yeah, in soft realtime this does matter. It's the difference between 20 and 60fps. It can easily be even the difference between 0.1 and 60fps.
- kstenerud 11y ago> One has to know what kind of constructs the compiler can work well with and then change the problematic code to such that the compiler can produce efficient code out of. Great! And luckily C++ allows you to do this. Once you've profiled and found the bottlenecks, you can get as low level as you need to solve it. Far better to remain idiomatic until you find a problem rather than painting yourself into a bunch of low level architectural corners with no justification other than "it might be slow".