4 ms·
You have it backwards; cache effects only start to matter once you have the other things right. For example, being able to transform boxed to unboxed arithmetic
by _delirium 11y ago
You have it backwards; cache effects only start to matter once you have the other things right. For example, being able to transform boxed to unboxed arithmetic, or to optimize out function calls from tight loops, will, at least in most cases, give you a bigger performance boost than rearranging data for cache-friendliness will.
- vvanders 11y agoI dunno, depending on your architecture you're looking at 200-400 cycles per cache miss, that's a lot of function calls.
- Someone 11y agoMany function calls are a cache miss. That doesn't matter much if each function call accesses thousands of memory locations, but if you have many small functions such as calls to (un)box objects or property accessors, or small closures you pass to a function, getting rid of the function calls by inlining code makes a huge difference.
- otabdeveloper 11y agoThe reason why unboxed arithmetic and inlined function calls matter is that they allow for data locality, i.e., better control over cache and memory access patterns.