2 ms·
Optimizing VMs often use lots of memory for various reasons. Specific costs in modern optimizing VMs include the memory for the JITed code, and with multiple ti
by azakai 4y ago
Optimizing VMs often use lots of memory for various reasons. Specific costs in modern optimizing VMs include the memory for the JITed code, and with multiple tiers you end up JITing each function more than once. You also need memory to save information about which functions to tier up (a call count or something more refined). Even things like polymorphic inline caches have a cost, the space for each of those PICs, and the code around them.
A simple interpreter can avoid all those. It can build a very simple and compact bytecode and just execute that.
(But, of course, the speedups in optimizing JITs are usually worth it! 10x or more.)
- galangalalgol 4y agoDoes the engine store compiled binaries for the next time the page is loaded?
- azakai 4y agoSome (most?) do, yes, here is a V8 article on that for example: https://v8.dev/blog/wasm-code-caching https://v8.dev/blog/wasm-code-caching
- galangalalgol 4y agoThat seems to imply julia for wasm on chrome wouldn't have the "time to first plot" issue.