3 ms·
How does shared_ptr work? Reference counting? No wonder that's slow and wasteful of both cache and branch prediction. What's wrong with using a proper generati
by M_Bakhtiari 8y ago
How does shared_ptr work? Reference counting?
No wonder that's slow and wasteful of both cache and branch prediction. What's wrong with using a proper generational moving garbage collector?
- saagarjha 8y ago> How does shared_ptr work? Reference counting? Yep. > What's wrong with using a proper generational moving garbage collector? Because then you don't have deterministic performance which is necessary in certain contexts–or am I misunderstanding you here?
- M_Bakhtiari 8y agoDeterministic performance hasn't been a thing since the early 90s. I'll settle for just performance. But sure, there are cases where you want the level of predictability of reference counting, in which case I'd rather take the performance penalty than spend time and pollute the codebase doing a lot of tricks to arrange memory as a compacting garbage collector would.