Tarantool development patches archive
 help / color / mirror / Atom feed
From: Alexander Turenko <alexander.turenko@tarantool.org>
To: Konstantin Osipov <kostja.osipov@gmail.com>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH 1/2] box: make box.cfg idempotent function
Date: Wed, 6 May 2020 14:17:06 +0300	[thread overview]
Message-ID: <20200506111706.m6vxgduyaa3ay3mr@tkn_work_nb> (raw)
In-Reply-To: <20200319071920.GA3227@atlas>

> > However you might suggest another fix for the issue? There are several
> > other ways to indicate whether box is configured, e.g. introduce the
> > specific value to the box table. What do you think?
> 
> Why not set a lua variable *from* C instead of calling from Lua
> *into* C each time?

This way it will be slower when called from C. Since we unable to
'unconfigure' box I would just cache C's value in Lua.

C's box_is_configured() is used only in box.session.su() and its
performance is not so critical as box.execute(). However I don't see a
reason to slowdown C's box_is_configured()() if we can avoid it: it may
be important if it will be called from some other code.

I don't sure, but storing database settings and state in Lua looks a bit
lopsided approach for me: even now we have three languages: C, Lua and
SQL. Some caching, hovewer, is okay.

> I mean, this is an obvious optimization, but it is only worth it
> if there is a measurable slowdown (which I suspect there is, at
> least a couple of %, but even a couple of % IMHO justify it).

I failed to obtain stable results and maybe there is a difference, but I
don't see it now.

https://gist.github.com/Totktonada/407855389ed4da93bf0175cf8a11c7b9

I made those measurements on fixed CPU frequency and 10 times run each
implementation 10 times: 300 runs at whole. I see that results becomes
worse for all implementations from run to run. Looks strange.

WBR, Alexander Turenko.

  parent reply	other threads:[~2020-05-06 11:17 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-14 11:50 [Tarantool-patches] [PATCH] box.execute should be immutable function Maria
2019-11-14 16:51 ` Nikita Pettik
2019-12-17 14:39 ` Igor Munkin
2019-12-24 15:32   ` [Tarantool-patches] [PATCH] box: make box.execute() immutable Maria Khaydich
2019-12-25  1:30     ` Igor Munkin
2019-12-26 14:08     ` Alexander Turenko
2020-01-13 12:13       ` Maria Khaydich
2020-01-13 15:48         ` Igor Munkin
2020-01-18 10:56           ` Maria Khaydich
2020-02-20 17:51             ` Alexander Turenko
2020-02-20 21:15               ` Igor Munkin
2020-03-11 15:56               ` Maria Khaydich
2020-03-18 22:25                 ` Igor Munkin
2020-05-02 14:52                   ` Alexander Turenko
2020-05-12 16:16                 ` Alexander Turenko
2020-03-11 15:57               ` [Tarantool-patches] [PATCH 1/2] box: make box.cfg idempotent function Maria Khaydich
2020-03-12 13:29                 ` Konstantin Osipov
2020-03-12 19:25                   ` Maria Khaydich
2020-03-12 20:00                     ` Konstantin Osipov
2020-03-18 22:26                       ` Igor Munkin
2020-03-19  7:19                         ` Konstantin Osipov
2020-03-19  9:08                           ` Igor Munkin
2020-03-19 10:06                             ` Konstantin Osipov
2020-03-19 10:26                               ` Igor Munkin
2020-05-06 11:17                           ` Alexander Turenko [this message]
2020-05-06 11:49                             ` Konstantin Osipov
2020-05-06 12:53                               ` Alexander Turenko
2020-05-06 13:02                                 ` Konstantin Osipov
2020-05-06 13:13                                   ` Alexander Turenko
2020-03-18 22:26                 ` Igor Munkin
2020-05-12 16:17                   ` Alexander Turenko

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=20200506111706.m6vxgduyaa3ay3mr@tkn_work_nb \
    --to=alexander.turenko@tarantool.org \
    --cc=kostja.osipov@gmail.com \
    --cc=tarantool-patches@dev.tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH 1/2] box: make box.cfg idempotent function' \
    /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