[Date Prev][Date Next][Thread Prev][Thread Next]
- From: Jakub Piotr Cłapa <jpc-ml@...>
- Date: Sun, 20 Nov 2011 01:50:10 +0100
On 18.11.11 16:44, Tim Caswell wrote:
While of course you'll have better performance writing hand-tuned lua
performance cost is as bad as you think.
The bulk of time spent in most luvit programs is *not* running lua
code. It's making calls into the C library. Just for fun, I took one
of my benchmarks and disabled the jit option in luajit (which should
make pure lua execution up to 64 times slower) and it was only about
2% slower! Also comparing the same benchmark to an equivalent program
in nodejs and luvit was 4 times faster. After digging in and talking
to someone on the V8 team, it seems the main difference was the fact
that V8's js/c++ boundary is much slower than the lua/C translation in
So yes, auto-generated lua code would be slower, but I don't think it
would be very significant to overall program speed. Also since luvit
uses 40 times less ram than node in my tests, you might even come out
ahead there too.
Thanks for this comment. These results are what I was hoping for.
Especially the low RAM usage may be a really good thing for running Lua
The harder problem would be making a clean and complete translation of
features. The two languages are surprisingly similar but very
different in deep ways.
I guess the only way to find out is to try to do this. :)
Jakub Piotr Cłapa