lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

On 18.11.11 16:44, Tim Caswell wrote:
While of course you'll have better performance writing hand-tuned lua
in luvit than auto-generated lua from javascript, I don't think the
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 (and/or translated JavaScript) on embedded Linux (things like OpenWRT).

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