Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Compacting GC almost always has better cache utilization than malloc

...only if you put each object into its own heap allocation, which is a dumb thing to do in manual memory management. Typically you'd group many related objects of the same type tightly packed into the same allocation and loop over them in sequence to make proper use of prefetching.

The programmer will always have a better idea how objects are going to be used compared to an automatic memory management solution, and even with a GC it makes a lot of sense to use arrays of value types for better memory layout control.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: