lua-users home
lua-l archive

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


On Thu, 20 Dec 2001, Joshua Jensen wrote:

> It is ridiculous to perform a table lookup, have it fail, call a
> tag method to do yet another table lookup, when you know exactly where
> the function you needed to call is already (in the handler table),
> thereby only resulting in one table lookup.

Almost all work of an untyped language is "ridiculous", as it spends
most of its time doing things that we "know exactly" the result
(checking that the table is actually a table, performing a table lookup
instead of using a fixed offset into a structure, etc.).


> Is there a solution to the speed issue?

If/when you have a real speed issue, then you can copy only those
critical methods into your objects, you can "cache" methods inside loops,
or better still, you can use C.

-- Roberto