3 ms·
Maybe there’s an inflection point where imperative management of the cache is more effective than heuristic management.
by hinkley 7y ago
Maybe there’s an inflection point where imperative management of the cache is more effective than heuristic management.
- mhh__ 7y agoWhat do you mean by imperative? Static control by the program?
- cryptonector 7y agoI'm guessing u/hinkley meant having an API for the cache, so a compiler could generate instructions to prefetch cache lines (and maybe even keep them hot) rather than depend on automatic (heuristic) cache management.
- Reelin 7y agoJust FYI, prefetch instructions are already a thing (at least on x86). At present they're only hints to the underlying heuristic system though. (https://www.felixcloutier.com/x86/prefetchh https://www.felixcloutier.com/x86/prefetchh) Cache-as-RAM is also a thing, and allows the sort of pinning you described. Pretty specialized use cases though. (https://stackoverflow.com/questions/41775371/what-use-is-the-invd-instruction https://stackoverflow.com/questions/41775371/what-use-is-the...)
- gwking 7y agoI saw Alan Kay speak once, I think at lambda jam 2013. He made a comment that he’s still waiting for mainstream CPUs to allow us to fit an entire interpreter into on-core cache.
- adrianN 7y agoForth interpreters probably fit into L1 on modern processors.
- Dylan16807 7y agoAnd we've had 256KB L2 since the Pentium Pro. That's big enough for a Lua interpreter.
- PeCaN 7y agoEh? The LuaJIT and K interpreters definitely fit into L1 instruction cache. (And have since well before 2013 probably.) Honestly I would be kind of surprised if most interpreters for reasonably small languages don't fit into icache. Sure Python's not going to any time soon, but most interpreters are really not very large.
- RantyDave 7y agoYou could get Windows NT 4 running in a processor cache these days.