Comment

Comment by fooker

I am a compiler engineer and this is not as great as it seems like.

If you are replacing pointer chasing with arbitrary indexes into arrays, you are likely going to make it orders of magnitude slower for large arrays. (It's barely worth it even if the array fits in L1)

It's counterintuitive because pointers have been optimized on hardware for about 50 years, and array indices are just pointers that your hardware doesn't know about.

The main things that go wrong are hardware prefetching and compiler optimizations taking advantage of alias analysis.

parent fooker 3 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton