lua-users home
lua-l archive

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


Matthew P. Del Buono wrote:
> Unfortunately, this required a fully automated build across several
> platforms using CMake, so I had to essentially rewrite LuaJIT's makefile
> in CMake format and consider the (notably minor, but important)
> differences between platforms. Because I've never used LuaJIT before,
> I'm pretty willing to admit I'll have likely screwed something up there.

Wouldn't it be easier to build LuaJIT separately and then add it
as a link dependency to the project?

> That being said, it compiles properly and runs like a charm.
> Unfortunately, I don't see much difference, if any.

Obviously then your bottleneck is not in the Lua code itself.

If you only spend (say) 5% of the CPU time in Lua code and LuaJIT
would give you a speedup of (say) 5x, then you'd get a 4% speed
difference at best. This is probably within the noise level of a
complex application.

Oh, BTW, a common pitfall other people supposedly have fallen into
before (ahemm): make sure your app doesn't sync to a fixed frame
rate or some subdivisor of it. Because then you'll never be able
to tell a difference in the FPS. ;-)

> What I'm trying to get at is that I think that we /should/ be getting a
> decent performance improvement, but aren't. Does anyone have a
> suggestion on how I might be able to investigate what LuaJIT is doing in
> hopes of tuning its performance (or, more likely, fixing something I'm
> just plain doing wrong)?

Profile your whole application and find out where it spends most
of its CPU time. If it's not inside Lua, then there's no point in
spending time on improving its performance.

> Because it's not a standalone application, it seems I can't use
> the "-jv" option.

I bet you can. Just redirect it to a file:

  require("jit.v").start("dump.txt")

--Mike