[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: [ANN] Luvit - Lua + UV + Jit = NodeJS re-implemented in Lua
- From: Tim Caswell <tim@...>
- Date: Thu, 1 Dec 2011 08:03:24 -0600
On Thu, Dec 1, 2011 at 7:51 AM, Dieter Plaetinck <firstname.lastname@example.org> wrote:
> On Wed, 30 Nov 2011 12:56:57 -0600
> Tim Caswell <email@example.com> wrote:
>> If you're familiar with nodejs, it's quite similar (...)
> it looks very cool, but i have to ask: why?
> anything with speed, reliability, available libraries? language features?
> or the fact that lua is a smaller language with a simpler implementation, and hence easier to work with to build this?
> on your github page I read "In initial benchmarking with a hello world
> server, this is between 2 and 4 times faster than nodeJS."
> do you know why this happens? can we conclude the lua jit runtime is just more efficient than js?
> (http://luajit.org/luajit.html also mentions something like that)
As I mentioned on the nodeJS mailing list:
we call the internet.
2. V8's JS to C++ conversion is really slow compared to luajit's Lua
to C layer. Also V8 uses a lot more ram and starts up much slower.
3. Co-routines in Lua are really nice and with very little extra
sugar make a simple, obvious, and effective way to write sync style
code while living in an async world.
Because of discovery #1, I don't think Luvit will ever become more
popular than nodeJS, especially for anything web related. I see Luvit
being used for things like mobile devices where performance *really*
matters, JIT can be disabled (think iOS), and the built-in FFI makes
SDL and openGL possible without bindings.
I don't think it's fair or accurate to say that Luajit runs Lua faster
Besides, in a Luvit program, most the time is not spend executing Lua
code, it's making sys calls. Just for fun I benchmarked Luvit with
and without Jit and it made only a 2% speed difference in the