4 ms·
It's easier than bash ;) It shouldn't really matter, Node is quite performant nowadays, but compared to a compiled language it might be slower, but easier to w
by neoeldex 9y ago
It's easier than bash ;)
It shouldn't really matter, Node is quite performant nowadays, but compared to a compiled language it might be slower, but easier to write up.
This project is a toy project, so why spend the time on optimizing ;)
- gwbas1c 9y agoIsn't node JIT? It might have a slower startup time, but it should be about as fast as a compiled language once running.
- udp 9y 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 9y 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 9y 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 9y 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.