lua-users home
lua-l archive

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


On Tue, 2003-12-16 at 10:19, Rafael Jannone wrote:
> Em Ter, 2003-12-16 às 12:13, Jeremy Cowgar escreveu:
> [snip]
> > The mod_lua is a clean C wrap. It currently ovewrites the print function
> > to send output to the client, also provides a import and include
> > function. It then exposes a tables, _REQUEST, _SERVER, _CONNECTION and
> > then two other tables about the data sent from the client, _GET and
> > _POST. Other than that, it also provides <?lua ... ?> block parsing so
> > you can:
> > <? for i=1,10 do ?>
> > Hello <?lua print(_GET.name or _POST.name) ?>
> > <? end ?>
> [snip]
> 
> I'm curious, do you have any benchmarks comparing mod_lua vs php
> performance?  Specially regarding string operations... (concatenation,
> regular expressions, etc)?

Not yet... I did do a simple:

<?php print("Hello, World!"); ?>

and 

<?lua print("Hello, World!") ?>

although this is a very generic test which probably does not really show
anything, on my system (P4 1.4, 640mb) mod_php was 831 requests/sec and
mod_lua was 1105 requests/sec.

Now, their are quite a few things that mod_lua was not doing, such as
sessions, etc... and also these are quite erratic...meaning, did I have
X loaded at that time? What other things were going on? The tests were
done at the same time, in the same environment, but at different times
results are different. I will do more accurate and detailed tests a
little later. 

Mod_lua also is not caching anything yet... so, the <?lua ... ?> is
parsed each time and something like:

<html><body><h1>Hello</h1>
<?lua print("Hello, World!") ?>
</body>
</html>

is actually turned into a lua script:

print("<html><body><h1>Hello</h1>")
print("Hello, World!")
print("</body>")
print("</html>")

and then executed... I will be implementing a cache type system that
will store the converted pages and then execute them if the date has not
changed. This will turn into an option to enable caching, disable
caching, check dates, or don't check anything, always use the cached
file (production).

Once mod_lua get's a little more defined in it's api, I will begin some
comparison tests and publish the results on modlua.cowgar.com.

----
jeremy <jc@cowgar.com>