lua-users home
lua-l archive

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

On 2 May 2011 13:51, steve donovan <> wrote:
> On Mon, May 2, 2011 at 2:38 PM, Krunal Rao <> wrote:
>> Just curious, is there a specific reason why this would be much better than the
>> m[i][j]  syntax which is achievable at the moment?
> In Francesco's experience, m[i][j] can be relatively expensive, since
> m[i] must return an indexable object. So it's an optimization concern.

Yes, but it's my understanding that he's working with LuaJIT.
My experience is that it's possible to create matrix classes via FFI
that do not
suffer from this issue (see my previous post).
Actually, even for tables (I tested only the case where they contained
just matrix
entries) LuaJIT optimize away the temporary in my simple benchmarks using the
m[i][j] syntax.