3 ms·
I disagree. JS optimizations are implementation defined. They are also largely undocumented. You will have to read source code if you want to know the truth, o
by 29athrowaway 5y ago
I disagree.
JS optimizations are implementation defined. They are also largely undocumented. You will have to read source code if you want to know the truth, or write microbenchmarks to probe the VM behavior.
Your optimization from today can be deoptimized tomorrow. There are no documented guarantes that certain code will remain fast.
Knowing about inline caching, shapes, smis, deoptimizations and trampolines... does helps. But the internals are unintuitive.
Instead, I can save myself that time and use WASM instead.
There are so many things that can trigger a deoptimization that I would rather ignore them all and do it in WASM instead.