[Tarantool-patches] [PATCH 2/4] box: add binary search for _session_settings space
Vladislav Shpilevoy
v.shpilevoy at tarantool.org
Tue Mar 17 01:53:31 MSK 2020
Hi! Thanks for your comments!
On 16/03/2020 15:16, Nikita Pettik wrote:
> On 17 Feb 15:12, Chris Sosnin wrote:
>> As it is mentioned in implementation, it is important
>> that _session_settings options are sorted by name, so
>> there is no need in linear lookup and we can replace it
>> with binary search.
>
> Is there any sufficient performance benefit except for code complication?:)
> I really doubt that this part should be optimized for such rare in
> terms of usage place.
We didn't measure perf increase, but for such a simple change it
did not seem necessary.
Talking of rareness of settings change - this is arguable. Firstly,
every new session will change settings, if a user's project uses some
of them permanently. Secondly, some settings, such as default engine,
or constraints related, or similar can be changed on per-request basis,
in case user wants to make some requests not checking FK, and others
should check them, inside one session, for instance. Similar necessity
can arise for other settings. I think we can actually measure how faster
lookup became for that case.
> What is more, there's only dozen entries, so
> binary search doesn't really make any sence. Idk why Kirill assigned 2.4.1
It is only dozen for now. This will change. We already have read-only
session coming.
> milestone, IMHO there are way far more important things to elaborate on.
Honestly, I was thinking there is not much to elaborate. This is
trivial bsearch.
More information about the Tarantool-patches
mailing list