3 ms·
I might be totally missing something here, but wouldn’t using raw pointers include using new/delete, so all those small C++ objects would also live on the heap.
by mr_00ff00 3y ago
I might be totally missing something here, but wouldn’t using raw pointers include using new/delete, so all those small C++ objects would also live on the heap.
Are you saying smart pointers and there overhead make the heap allocations even bigger and that’s the cause of the cache misses?
- flohofwoe 3y agoI guess this got lost in the wall of text :) > But the problem there is deeper: it's not smart pointers vs raw pointers, but that each small object lives in its own heap allocation. Smart-pointers do encourage to create small heap allocations though (because unlike raw pointers they manage ownership).