Re: LuaJIT2 performance for number crunching
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: LuaJIT2 performance for number crunching
- From: Mike Pall <mikelu-1102@...>
- Date: 2011年2月13日 16:18:04 +0100
Leo Razoumov wrote:
> > In Lua we can do the same: specialize the Lua code at runtime for
> > the number of dimensions, memoize the code in a table and dispatch
> > based on the dimension. I.e. string.format + loadstring +
> > memoization table.
>
> It would be great if this specialize/memoize/dispatch optimization for
> small number of dimensions could make it into LuaJIT-2.0 release.
Umm, you misunderstood: this out of the scope of what a compiler
automatically can or should do for you. C++ compilers don't write
templates for you, either. :-) It's pretty easy to do it yourself
in Lua, far easier than writing C++ templates.
--Mike