I have a template which is being used in many many many different places inside my code.
Part of the template in question is along the lines of:
callSomeProc "with" & someVar & "and" & anotherVar
Since, someVar and anotherVar are known at compile-time, the whole string is compiled at compile-time.
The result? When I strings -a my binary, it's literally FULL of all the possible variations of the aforementioned string.
The question is: how do I keep the template (I definitely need to), but have the string calculated at runtime, in order to avoid all this unnecessary junk string data?
Basically, it's what I mentioned above.
I generally care about speed and performance a lot - so compile-time is usually better.
But in this particular case, since the code in question will run only when the app crashes (in which case, it's already late - and performance is not the issue), it would be quite better not to have a bloated - with string data - binary. No?
Issues solved.
I kept the template, and move just this particular line into a separate proc.
Result: roughly -10% decrease in the resulting binary! :)