3 ms·
In small programs like this, it might not even take a lot of effort. It's trivial to read a program like this and make a very good guess as to where bottleneck
by emn13 10y ago
In small programs like this, it might not even take a lot of effort. It's trivial to read a program like this and make a very good guess as to where bottlenecks are without even running it, let alone profiling it. That kind of simplicity gets lost quickly, however, when programs grow.
Then again, I don't really believe that the optimization opportunities are likely to ever matter much. At least not at this level. Perhaps for much more complicated things, e.g. a kind of compile-time sql or string-matcher the greater safety and the symbolic nature of the macros will let programmers write libraries that practically reason about instructions you give them and choose optimal strategies where C would need to do so at run time or with unmaintainable and unusable macros, but if it's just aliasing and some threading gains - well, those aren't huge often, and where they are, C can use em unsafely too (and that's often quite doable too!).
Safety and maintainability sound like more realistic selling points to me - it may never actually beat C in real-world performance; but it doesn't have to - it just needs to come close.