7 ms·
Don't forget about the templates too. A generic collection is usually faster when implemented using templates instead of void*.
by raphaelj 11y ago
Don't forget about the templates too.
A generic collection is usually faster when implemented using templates instead of void*.
- jakub_h 11y agoUnless you use a DataDraw-like approach, I presume. I can't see templates doing similar amounts of data rearrangements.
- Kristine1975 11y agoYou'd be surprised: http://bannalia.blogspot.de/2015/09/c-encapsulation-for-data-oriented.html http://bannalia.blogspot.de/2015/09/c-encapsulation-for-data...
- jakub_h 11y agoSetting aside the cringe I experience whenever supposed principles of "OOP" are mentioned by the author, that page painfully reminds me of the that old joke about bolting four extra legs onto a dog... Furthermore, both a broader comparison (for more complex data and processing) and the technique I mentioned seems to be absent. However, I suppose it shows how to reclaim at least some benefits of better data arrangement even if the language isn't a good fit.
- Rexxar 11y agoDid you speak of this "datadraw.sourceforge.net" ? It's the first time I heard of it. Have you used it ?
- jakub_h 11y agoFor a number of reasons, I'm not particularly fond of this specific implementation but I'm seriously considering porting its principles into something else (where they might work even better).