|
On 13/12/2010 10.47, Dirk Laurie wrote:
Lua 5.2.0 (alpha) Copyright (C) 1994-2010 Lua.org, PUC-Rioa={1,2,nil,4,5,6,nil,8,nil,nil,nil,12,nil,nil,nil}; return #a[0,7] [0,3] [1,3] [2,3] 2a={1,2,nil,4,5,6,nil,8}; a[12]=12; return #a8 No binary search at all in the array+hash case!
Interesting, but what I'm specially interested is: given a proper array (no holes), does #t access time get worse if I add a hash part to it?
It would seem so from your post, but from a quick test I note no execution time difference.
-- Enrico