[tarantool-patches] Re: box: disable sparse optimization in box.tuple.new()

Konstantin Osipov kostja at tarantool.org
Tue Feb 12 14:33:46 MSK 2019


* Kirill Shcherbatov <kshcherbatov at tarantool.org> [19/02/12 14:23]:
> The box.tuple.new() used to call luamp_encode_tuple with
> default LUA serializer config 'luaL_msgpack_default'. This
> routine may consider an array to be excessively sparse when
>   + encode_sparse_ratio > 0
>   + max(table) > encode_sparse_safe
>   + max(table) > count(table) * encode_sparse_ratio.
> Sparse optimization save memory via representing excessively
> sparse tuple as MP_MAP. But Tarantool tuple always must be
> MP_ARRAY so it is not relevant for box.tuple.new semantics.
> So it is disabled with encode_sparse_ratio = 0 in a new local
> serializer config.

Why not keep a separate config around instead of tweaking the
default config each time?
-- 
Konstantin Osipov, Moscow, Russia, +7 903 626 22 32
http://tarantool.io - www.twitter.com/kostja_osipov




More information about the Tarantool-patches mailing list