lua-users home
lua-l archive

Re: Tuning tables

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


On Sat, Dec 15, 2018, at 14:05, Jasper Klein wrote:
> Something like these functions I had in mind:
> table.reserve( t, narray, nhash ) -- Reserves space for at least 'narray' 
> elements in the array part and 'nhash' elements for the hash part of the 
> table. May rehash if bucket count was increased.
> table.rehash( t, [nhash] ) -- Rehashes the table and optional reserve 
> 'nhash' elements for the hash part of the table.
This does not do everything you want, but some libraries just expose
`lua_createtable`. Are there practical use cases where this is not
enough, i.e. where you need to reserve space in an existing table
as opposed to during table creation?
-- 
Pierre Chapuis

AltStyle によって変換されたページ (->オリジナル) /