[tarantool-patches] Re: [PATCH v2 2/1] tuple: introduce bigref hints

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Fri Jun 8 13:36:40 MSK 2018



On 08/06/2018 06:28, Konstantin Osipov wrote:
> * Vladislav Shpilevoy <v.shpilevoy at tarantool.org> [18/06/05 00:01]:
>>      tuple: introduce bigref hints
>>      Typical usage of bigrefs: allocate many bigrefs in Lua in a row,
>>      reach memory threshold and delete many bigrefs in a row.
>>      Hits allow to make multiple refs deletions or creations be
>>      faster. For example, before the patch complexity of N refs with
>>      C capacity in a row: O(C) * N.
>>      After the patch:     O(C) + N.
>>      Same about unrefs.
>>      Follow up #3224
> 
> Why not chain up all free links into a free list, similarly to
> what we do in the slab allocator?
> 
> 

True list of uint16 has to big overhead on next/prev pointer.

If we use array instead of list, then we face with the same problem
as original bigref array has. Removal from the array produces gaps.

I have decided that the pair of simple hints is enough since the
typical bigref usage follows the scenario: create many bigrefs in Lua in
a row, that triggers lua GC, that frees many bigrefs in a row. My
hints graceful deal with it.




More information about the Tarantool-patches mailing list