I've heard of some techniques to optimize code and make it faster:
On one side are clearly relevant optimization: use of better algorithms, benchmarking, etc.
On the other side are techniques with a more doubtful relevance. I don’t know if they are a myth or a reality or just deprecated usage.
My question is about the latter ones. Some examples:
- Big function (several thousand lines) to avoid function call overhead
- No SRP to avoid Object overhead
- Reuse variable as much as possible instead of having scoped variables
- And many some other practices.
Often those techniques go against a readable, understandable and maintainable code base. So I'd like to know if they have a founded reason to exist.
A few things to note:
- I'm only assuming there may be rules in place and not that those are only bad practices that took root in code and in developers minds.
- I'm currently working in C++98 and accordingly old compiler and hopefully in c++14 more up to date compiler in the next future. I'd like to know if the answer depends of the environment
My question: Are those practices myths or reality? In the context of an application with heavy performance criteria (Like High Frequency Trading Software) could those practices supersede "good development" practices?