Hacker News new | ask | show | jobs
by jfkebwjsbx 2209 days ago
An optimizer can do many things until it cannot. Since you have no easy way to assert the overall performance of your program, you may end up with broken optimizations at some point in the future due to unrelated changes, pretty much non-deterministically.

In addition, more templates and more types means way less compiler throughput. That is why major parts of Boosts are avoided.

Not to mention human throughput too.

> compiling a push_back call for each item would get inefficient, memory and cache-wise?

That depends a lot on what you are doing.

By the way, if you are dealing with tons of constants in your code, then it usually means the design of the application is likely inflexible and a code smell overall.