lua-users home
lua-l archive

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


On Tue, Dec 08, 1998 at 09:25:36AM -0200, Luiz Henrique de Figueiredo wrote:
> >From: Supratik Champati <champati@sofy.com>
> >
> >Also I was wondering if someone has already written (and would
> >graciously like to share)
> >some kind of lua add-on that would enable us to dynamically load object
> >files.
> 
> yes, someone here at TeCGraf has done that.
> it'll probably be part of Lua 3.2 (but as a library).
> 
> >The reason I need this is that some functions are too time consuming to
> >be implemented in lua
> 
> I assume you have profiled the code...

So far the stuff I've implemented outside of lua is more a result of
Lua not handling integers very well. For example, bitshifting. 

So far the 'worst' performance Lua code I've made is a proto-style
'multiple-inheritence' and it's poor performance comes from:
  1) deep nesting, which just means Lua has to walk many tables
     - I want to setup a 'flattening cache' which will flatten all the
       parent tables and then invalidate and reload if any of the
       parent tables change. However, accessing non-reference types
       is always going to involve more indirection than I want, the
       minimum I can get it down to is:

        object->parent->reference_tbl->value

       Where I create a special table called a "reference_tbl" which
       allows me to store a 'reference' to a string or integer by storing
       the table it lives in and its index.

  2) "false" is the same as "not present". Which means if I have a false
      value somewhere, it has to parse the whole tree just to not find the
      variable anywhere in the tree. I'm moving to using "0" and "1" for
      booleans, but I really would like to have a proper boolean type.

-- 
David Jeske (N9LCA) + http://www.chat.net/~jeske/ + jeske@chat.net