I am coding an obsessive data structure and wondering whether to use basic or custom interceptors. Since the code will be called many times, my question is about performance and to what extent compilers can embed such code.
Base hooks are based on inheritance, while hook elements use member pointers through template parameters. My design choice would be to use element hooks, but my experience says pointers are much harder to optimize than static code. On the other hand, all of these pointers are known at compile time, and perhaps the compiler can do some magic to analyze what happens.
Does anyone have any experience? Any data, tips or links are welcome.
source
share