lua-users home
lua-l archive

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


> We thought about that for Lua 4.0, but it brings a performance problem.
> In many machines (Linux, for instance), the size of a TObject is not
> a power of 2, and so the difference between two (TObject *) is not
> an efficient operation.

i.e. because a division is needed to go from address difference to stack
slot number. I'm not even sure this is a reasonable argument: after all,
you're dividing by a constant, which any compiler worth its salt turns into
a multiplication, which is cheap on almost all machines you'd be running Lua
on.

Wasting programmer time to gain machine time is rarely worth it, and really
needs to be backed up with figures. Here it really doesn't seem worth it at
all, unless I'm missing something big.

-- 
http://sc3d.org/rrt/ | Caution Children At Play Drive Slowly