Hacker News new | past | comments | ask | show | jobs | submit login

pretty sure a memory access is faster than the methods presented in the article.



Depends also heavily on the context. You pay for each cache miss twice - once for the miss itself, and next time when you access whatever was evicted during the first miss. This is why LUTs often shine in microbenchmarks, but drag down performance in real world scenarios when mixed with other cache bound code.


Hitting L2 is more than 3-4 cycles


Access to main memory can be many many cycles; a short routine already in cache may be able to recompute a value more quickly than pulling it from main memory.


An uncached random memory access is around 100 cycles.


100 cycles would be very low. Many systems have more than 100 ns!


You are correct. I used the wrong unit:

https://jsmemtest.chipsandcheese.com/latencydata

We can say around 100ns, although likely somewhat more.


64K is enough to fill L1 on many systems




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: