You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Brian McCallister <br...@skife.org> on 2009/02/06 06:21:42 UTC

[mod_lua] bytecode caching

It looks like fields were added to apl_vm_spec to allow for bytecode
caching on the actual spec. I think this is a bad idea. Specs are
short-lived, typically stack-allocated, structs which exist to group a
bunch of arguments together.

If we choose to re-enable bytecode caching in mod_lua, it should be
done as a hook on source code loading where the cache is managed by
the bytecode caching module (which may be mod_lua, or may not be) and
if the cache hook doesn't fill in the sources, the fallback one loads
the file an compiles them.

-Brian

Re: [mod_lua] bytecode caching

Posted by Brian McCallister <br...@skife.org>.
On Thu, Feb 5, 2009 at 9:39 PM, Brian McCallister <br...@skife.org> wrote:

> I can see how this fits with the spec, but I'd still prefer to find a
> different way to pass that information. One way, though I do not like
> it much more, is to pass the bytecode in as the filename and look for
> lua bytecode's initial bytes: 1b 4c 75 61 51 00 ( <escape> Lua <null>
> ) -- this is kind of stinky overloading, but not *totally* insane.

<escape> LuaQ <null>

sorry :-)

Re: [mod_lua] bytecode caching

Posted by Brian McCallister <br...@skife.org>.
On Thu, Feb 5, 2009 at 9:21 PM, Brian McCallister <br...@skife.org> wrote:

> It looks like fields were added to apl_vm_spec to allow for bytecode
> caching on the actual spec. I think this is a bad idea. Specs are
> short-lived, typically stack-allocated, structs which exist to group a
> bunch of arguments together.

Ah, I see now why it was done -- to get the inline blocks working. Clever.

I can see how this fits with the spec, but I'd still prefer to find a
different way to pass that information. One way, though I do not like
it much more, is to pass the bytecode in as the filename and look for
lua bytecode's initial bytes: 1b 4c 75 61 51 00 ( <escape> Lua <null>
) -- this is kind of stinky overloading, but not *totally* insane.

Not sure where to lean on this... it is part of the spec, as used --
"here is a script literal" -- looking for thoughts.

-Brian