[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Tuning tables
- From: Pierre Chapuis <catwell@...>
- Date: Sat, 15 Dec 2018 19:04:14 +0100
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