4 ms·
You want to be careful with this technique when payload size dominates your application's performance, like on a webpage. I was looking into improving Emscripte
by hackcasual 5y ago
You want to be careful with this technique when payload size dominates your application's performance, like on a webpage. I was looking into improving Emscripten's pre-execution behavior, but found that ended up making perf worse when factoring in standard download speeds. The functions it removes are usually smaller than the data they add, usually with worse entropy. So while JS is faster to execute, it's usually not faster than the transfer time.
It gets a bit worse if your initialization code is doing a lot of dynamic allocation, as you're shipping
- Softcadbury 5y agoFor the first call maybe, but then with the cache ?
- wffurr 5y agoYou can't ever rely on the browser cache. Hit rates are very poor. Unless maybe you're managing cache yourself with a service worker.
- jfrunyon 5y agoThat depends entirely on what you're developing (internal vs external etc.) and how frequently the resource will be needed.
- hackcasual 5y agoYou're really only saving a few milliseconds, and keeping cached files small is valuable.