4 ms·
I have understood that current JIT compilers for JavaScript are smart enough to recognize when a function is called with the same type of arguments and compile
by fjfaase 6y ago
I have understood that current JIT compilers for JavaScript are smart enough to recognize when a function is called with the same type of arguments and compile the function into an optimized form making use of this typing knowledge. So, adding types to JavaScript might no result in a great performance boost. If will definitely make JavaScript more verbose which might have a negative effect on performance.
- alcover 6y ago> making use of this typing knowledge That makes JIT a complicated business, for you still have to accept any value. So two versions of the func would have to coexist ? One strong and one weak ? I'm no JS/JIT expert..
- fjfaase 6y agoHave a look at https://hacks.mozilla.org/2017/02/a-crash-course-in-just-in-time-jit-compilers/ https://hacks.mozilla.org/2017/02/a-crash-course-in-just-in-...
- alcover 6y agoThanks, I read it. It is like I thought : holding different optimisation versions of the same code... that is overly complicated in my (naive) view.