route via casted object type parameter.. or an if else branch tree where you route based on object type again
Branching is rather slow - especially if you arent careful in your probabilities. (templated-)Overloaded functions are evaluated at compile time, hence why your code takes a while to compile when you have many different template-types
but say if i have 36 types here.. functions compiled will be 36, don't think their layout will be much faster than branching it..will it?
The compile time of 36 functions is quite high, but calling one function is much faster than having 36 if's
You have more used RAM and a slightly bigger file (this behaviour scales linearly) and the compile time is slower
Compiling 36 variants of a functions takes more time than compiling one variant - where am I overlooking something?
Ahh I thought you were talking about runtime performance
Okay, then we agree!
hope you are right.. any links if you remember even tangential to this?
Обсуждают сегодня