lua-users home
lua-l archive

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

I don't know about speed (would probably guess the same as you) but i'd go primarily on the "cleaniness" of the model. That is, if you want to represent hierarchy, use subtables. If you use them just as 'bags' (indices don't matter) then flatten them.
That what i do, at least.. :)


Brett Bibby kirjoittaa perjantaina, 14. marraskuuta 2003, kello 09:10:

I looked at the LL3 slides and that got me wondering....  Our game
editor allows the user to create table definitions just like defining C
structs, where a struct can include other structs.  Currently we
"flatten" these nested tables into a single lua table so there's no
nesting of elements.  Is this better (where better means faster runtime
performance) or would it be better to leave the nested tables?  We had
assumed that a direct, flat table element access was faster....