3 ms·
Isn't node JIT? It might have a slower startup time, but it should be about as fast as a compiled language once running.
by gwbas1c 10y ago
Isn't node JIT? It might have a slower startup time, but it should be about as fast as a compiled language once running.
- udp 10y agoNot as fast as a compiled language, because JavaScript is too dynamic to apply the same kind of aggressive JITing that things like the JVM or CLR can. It is, however, "fast enough"(tm).
- gnode 10y agoYou say that, but in some ways it has the potential to be faster. JIT compilers can recompile code at runtime making use of a profiler, optimising specifically to both the host and the use case. Modern JavaScript VMs like V8 will often optimise functions treating types as static, then "deoptimise" in the rare case their type assumptions are broken.
- sedachv 10y agoBenchmarks or GTFO. Tracing JITs are hard to implement, use up a lot of memory, and cannot efficiently implement many kinds of control flow[1]. AFAIK TraceMonkey was the only JavaScript tracing JIT and it was not that great.[2] [1] https://news.ycombinator.com/item?id=13774326 https://news.ycombinator.com/item?id=13774326 [2] https://en.wikipedia.org/wiki/SpiderMonkey https://en.wikipedia.org/wiki/SpiderMonkey
- monocasa 10y ago> Modern JavaScript VMs like V8 will often optimise functions treating types as static, then "deoptimise" in the rare case their type assumptions are broken. And that logic that's needed to test invariants is exactly the overhead we're talking about.