Re:Maybe you don't need Rust and WASM to speed up your JS
by zbentley on Monday February 19, 2018 @03:02PM
(#16415288)
> Some languages apply it in some form for you under the hood.
I suspect some respondents will say, or believe, that this falls under the category of "you have to know the VM/runtime intimately to get good performance".
I don't think that's true. If you know the general problems with polymorphic call sites, you can (in JS and many other languages) check to see if the runtime is applying optimizations of this kind by being explicit. If it helps, you can get a free optimization by setting explicit arity/dispatch just because you happened to know about the issues surrounding polymorphic dispatch. That's a case of fundamental knowledge speeding up/improving your progress; not a case of "you need to know the VM guts like the back of your hand to make code fast".
I suspect some respondents will say, or believe, that this falls under the category of "you have to know the VM/runtime intimately to get good performance".
I don't think that's true. If you know the general problems with polymorphic call sites, you can (in JS and many other languages) check to see if the runtime is applying optimizations of this kind by being explicit. If it helps, you can get a free optimization by setting explicit arity/dispatch just because you happened to know about the issues surrounding polymorphic dispatch. That's a case of fundamental knowledge speeding up/improving your progress; not a case of "you need to know the VM guts like the back of your hand to make code fast".