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

Arrays shine when you access the elements in a predictable order.

That's what compiler backend and hardware optimizes for.

Blindly replacing pointers with random indexes into large arrays doesn't pan out.



This is still really vague. Doesn't pan out how exactly? Arrays aren't a thing at hardware level and are only sometimes a thing in compiler backend. Prefetching the next line helps, but it's irrelevant how the type is represented in the code. (And you can explicitly prefetch from a random address as well) What downsides are you talking about here specifically? Where do the orders of magnitude come from?




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

Search: