For example, there is hard logic inside function void Func(long param1, long param2, long param3, long param4, long param5)
.
It has a lot of statements inside depends on parameters, different checks, calculations depends on combinations and etc.
And that function is called many million times and takes serious amount of execution time. And I'd like to reduce that time.
All parameters are taken from config.ini
file, so, they are unknown at compile time.
But I know, that param1 may be in diapason [1..3], param2 in diapason [0..1] and etc.
So, finally, there is maybe 200 combinations of those parameters.
And I'd like my compiler compile separated 200 combination, and at the beginning of run-time, when config.ini
loaded, just choose one of them, and avoid run-time calculation of parameter's dependencies.
Is that possible to achieve in C++98? Or in C++11/14?