[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Tables and lists
- From: Axel Kittenberger <axkibe@...>
- Date: Wed, 5 Jan 2011 12:35:51 +0100
Didnt manage to crash it, looked through the source code, and looks
like an ok patch to me.
I suppose TM_COUNT is on purpose in the "fast" area of TMS?
One can argue the biggest downside is the increased memory use of
<struct Table> by 4 bytes. And the +-1 counting while running. Might
instead add numusearray() + numusehash() when requesting %count? Or if
kept the existing count could be used to optimize speed in rehash(). I
suppose this the typical case of deciding between memory use vs. CPU
BTW: The last days I've myself been studying the code around ltable.c
and if I could fit in a "all integer keys are sure a linear list" flag
(e.g. missuse bit 8 of marked? I don't see/grep any luaL_checkmemory
anyway) and what it would mean for performance. Where the flag not
set, would not guarantee it has not become a linear list by e.g.
filling the spaces, unless a linear traversal check. I'll let you all
know, if i get anything working.
On Wed, Jan 5, 2011 at 9:53 AM, Henning Diedrich <email@example.com> wrote:
> Hi Axel,
> I implented 'true length', if you care to take a look and try to crash it
> test/len.lua und test/strlen.lua are the files to test