3 ms·
All that proves is that V8 is a beast, similar to the JVM. Here's what an alternative world could look like: $ time luajit -e 'print"hello world"' hello wo
by wahern 7y ago
All that proves is that V8 is a beast, similar to the JVM. Here's what an alternative world could look like:
$ time luajit -e 'print"hello world"'
hello world
real 0m0.002s
user 0m0.000s
sys 0m0.002s
But it's worse than that, because the time at issue is for the AOT-compiled native code binary.
To be fair, I presume that the included runtime is written in C++, and modern C++ coding styles are pretty inefficient. Lots of small, dynamic allocations. Too much of the wrong kinds of abstraction. It's what happens when you shoehorn problems into established solution models, rather than approach development, including boiler plate code, as crafting a bespoke solution model fit to the problem. But the latter makes onboarding new engineers more difficult--you can't start hacking without first grasping the larger architecture--and therefore frowned upon in larger companies, or in small companies that equivocate big company approaches to "best practice".
- hedora 7y agoPoking around on my laptop, dash and perl take about 2ms. Python takes 12. Anyway, the modern c++ I use avoids allocations like the plague. I subscribe to the idea that C++ is a language for standard library implementors, and that std:: is mostly placeholders for the “real” implementation you’ll use later.