From: Vladimir Davydov <vdavydov.dev@gmail.com>
To: Kirill Shcherbatov <kshcherbatov@tarantool.org>
Cc: tarantool-patches@freelists.org
Subject: Re: [PATCH v5 2/4] memtx: introduce tuple compare hint
Date: Tue, 12 Mar 2019 16:00:05 +0300 [thread overview]
Message-ID: <20190312130005.wotntpiyq53yowm7@esperanza> (raw)
In-Reply-To: <53e165cf566611452821c692d79d621628e839ff.1551951540.git.kshcherbatov@tarantool.org>
On Thu, Mar 07, 2019 at 12:44:06PM +0300, Kirill Shcherbatov wrote:
> +/* {{{ tuple_aux_compare_with_key */
> +
> +static int
> +tuple_hinted_compare_with_key(const struct tuple *tuple, cmp_aux_t tuple_cmp_aux,
> + const char *key, uint32_t part_count,
> + cmp_aux_t key_cmp_aux, struct key_def *key_def)
> +{
> + uint64_t tuple_hint = tuple_cmp_aux.hint;
> + uint64_t key_hint = key_cmp_aux.hint;
> + if (likely(tuple_hint != key_hint && tuple_hint != CMP_HINT_INVALID &&
> + key_hint != CMP_HINT_INVALID))
> + return tuple_hint < key_hint ? -1 : 1;
> + else
> + return tuple_compare_with_key(tuple, key, part_count, key_def);
This will lead to double indirection - first you call
key_def->tuple_hinted_compare_with_key, which in turn calls
key_def->tuple_compare_with_key. This will introduce some
performance penalty, I guess. Avoid that, please.
next prev parent reply other threads:[~2019-03-12 13:00 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-07 9:44 [PATCH v5 0/4] box: introduce hint option for memtx tree index Kirill Shcherbatov
2019-03-07 9:44 ` [PATCH v5 1/4] memtx: rework memtx_tree to store arbitrary nodes Kirill Shcherbatov
2019-03-11 10:34 ` Vladimir Davydov
2019-03-11 16:53 ` [tarantool-patches] " Kirill Shcherbatov
2019-03-12 10:45 ` Vladimir Davydov
2019-03-07 9:44 ` [PATCH v5 2/4] memtx: introduce tuple compare hint Kirill Shcherbatov
2019-03-07 10:42 ` [tarantool-patches] " Konstantin Osipov
2019-03-07 10:59 ` Vladimir Davydov
2019-03-11 10:39 ` Vladimir Davydov
2019-03-11 17:03 ` Vladimir Davydov
2019-03-12 13:00 ` Vladimir Davydov [this message]
2019-03-07 9:44 ` [PATCH v5 3/4] box: move offset_slot init to tuple_format_add_field Kirill Shcherbatov
2019-03-07 15:53 ` [tarantool-patches] " Kirill Shcherbatov
2019-03-07 9:44 ` [PATCH v5 4/4] box: introduce multikey indexes Kirill Shcherbatov
2019-03-07 15:55 ` [tarantool-patches] " Kirill Shcherbatov
2019-03-12 13:24 ` Vladimir Davydov
2019-03-07 10:45 ` [tarantool-patches] [PATCH v5 0/4] box: introduce hint option for memtx tree index Konstantin Osipov
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=20190312130005.wotntpiyq53yowm7@esperanza \
--to=vdavydov.dev@gmail.com \
--cc=kshcherbatov@tarantool.org \
--cc=tarantool-patches@freelists.org \
--subject='Re: [PATCH v5 2/4] memtx: introduce tuple compare hint' \
/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