Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
To: Serge Petrenko <sergepetrenko@tarantool.org>, korablev@tarantool.org
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH v2 1/2] box: speed up tuple_field_map_create
Date: Tue, 1 Dec 2020 23:01:41 +0100	[thread overview]
Message-ID: <245a5084-7f35-ea9c-6259-a7d260b300a0@tarantool.org> (raw)
In-Reply-To: <e261dd7023735f5a09180969c1ae7966b7a8334f.1606734392.git.sergepetrenko@tarantool.org>

Hi! Thanks for the patch!

On 30.11.2020 12:14, Serge Petrenko via Tarantool-patches wrote:
> Since the introduction of JSON path indices tuple_init_field_map, which
> was quite a simple routine traversing a tuple and storing its field data
> offsets in the field map, was renamed to tuple_field_map_create and
> optimised for working with JSON path indices.
> 
> The main difference is that tuple format fields are now organised in a
> tree rather than an array, and the tuple itself may have indexed fields,
> which are not plain array members, but rather members of some sub-array
> or map. This requires more complex iteration over tuple format fields
> and additional tuple parsing.
> 
> All the changes were, however, unneeded for tuple formats not supporting
> fields indexed by JSON paths.
> 
> Rework tuple_field_map_create so that it doesn't go through all the
> unnecessary JSON path-related checks for simple cases and restore most
> of the lost performance.
> 
> Below are some benchmark results for the same workload that pointed to
> the degradation initially.
> Snapshot recovery time on RelWithDebInfo build for a 1.5G snapshot
> containing a single memtx space with one secondary index over 4 integer
> and 1 string field:
> 
>         Version            | Time (s) | Difference relative to 1.10
> ---------------------------|----------|----------------------------
> 1.10 (the golden standard) |    28    |             -/-
> 2.x (degradation)          |    39    |            + 39%
> 2.x (patched)              |    31    |            + 11%
> 
> Profile shows that the main difference is in memtx_tuple_new due to
> tuple_init_field_map/tuple_field_map_create performance difference.
> 
> Numbers below show cumulative time spent in tuple_init_field_map (1.10) /
> tuple_field_map_create (unpatched) / tuple_field_map_create (patched).
> 2.44 s / 8.61 s / 3.19 s
> 
> More benchmark results can be seen at #4774
> 
> Part of #4774
> 
> wip. optimisation.

You may want to delete the last sentence.

Other than that, looks good.

  reply	other threads:[~2020-12-01 22:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-30 11:14 [Tarantool-patches] [PATCH v2 0/2] reduce performance degradation introduced by JSON path indices Serge Petrenko
2020-11-30 11:14 ` [Tarantool-patches] [PATCH v2 1/2] box: speed up tuple_field_map_create Serge Petrenko
2020-12-01 22:01   ` Vladislav Shpilevoy [this message]
2020-12-02 10:07     ` Serge Petrenko
2020-11-30 11:14 ` [Tarantool-patches] [PATCH v2 2/2] box:refactor tuple_field_raw to omit path checks Serge Petrenko
2020-12-01 22:03   ` Vladislav Shpilevoy
2020-12-02 10:22     ` Serge Petrenko
2020-12-03 21:47 ` [Tarantool-patches] [PATCH v2 0/2] reduce performance degradation introduced by JSON path indices Vladislav Shpilevoy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=245a5084-7f35-ea9c-6259-a7d260b300a0@tarantool.org \
    --to=v.shpilevoy@tarantool.org \
    --cc=korablev@tarantool.org \
    --cc=sergepetrenko@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH v2 1/2] box: speed up tuple_field_map_create' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox