[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Lua design : why no lists ?
- From: Jarrod Roberson <jarrod@...>
- Date: Thu, 16 Sep 2004 10:47:00 -0400
Philippe Fremy wrote:
this is a non-issue if you just store the data in the key field and
nothing in the value field, they just treat the keys as a list, very simple.
For example, if you have a list of 10000 items, a lua table is going to
store the keys 1 to 10000 and to store the values too. A list would only
store the values. Iterating upon such a list is also quicker than over the
equivalent table because a double-linked list is easier to iterate over
than a list of hash.
either way there is nothing stopping you from writting a simple wrapper
facade around a table to make it "look" like a list, and if you
are as worried about performance as you seem to be you are probably
using the wrong tool, if performance is such an issue.