From: Sergey Kaplun <skaplun@tarantool.org>
To: Sergey Ostanevich <sergos@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org,
Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
Subject: Re: [Tarantool-patches] [PATCH v2] lua: remove excess Lua call from table encoding
Date: Tue, 9 Jun 2020 13:29:47 +0300 [thread overview]
Message-ID: <20200609102947.GA10550@root> (raw)
In-Reply-To: <20200608163517.GE50@tarantool.org>
Hi! Thanks for your comment!
@Changelog:
* Refactor Lua table encoding: removed excess Lua function object and
left protected Lua frame only for the case __serialize is a function
to improve `msgpack.encode()` performance.
On 08.06.20, Sergey Ostanevich wrote:
> Hi!
>
> The patch looks ok after I figured out that you actually sink the pcall
> down the callstack, keeping it only for the case __serialize is a
> function, leaving all other cases as is.
>
> What misled me is the changelog, where you mentioned you _removed_
> protected frame:
>
> * Refactor Lua table encoding: removed excess Lua function object and
> protected Lua frame creation to improve `msgpack.encode()` performance.
>
> I believe it'll be better to update the changelog descripton.
>
>
> LGTM,
>
> Sergos
>
>
> On 05 июн 10:14, Sergey Kaplun wrote:
> > Hi!
> >
> > It's a little bit complicated to find a good test that shows the
> > difference of behaviour. AFAIK there is only one case when we can face
> > with OOM error or so on - reallocating of Lua stack. But it can happen
> > with old version too (when we push cfunction, table or lightuserdata at
> > Lua stack before pcall). Now instead three values we push at Lua stack
> > only two (Lua function from metatable and table itself if serializing
> > function exists) before pcall. So with this patch the probability of
> > raising OOM error should be decreased.
> >
> > Of course we can check it with an eror injection, but it can be catched
> > with old behaviour too. It will be nice if you can provide any idea of
> > this kind of test to check this.
> >
> > On 02.06.20, Sergey Ostanevich wrote:
> > > Hi!
> > >
> > > Thanks for the patch!
> > >
> > > Still I would like to see some tests - perhaps with errinj to emulate
> > > OOM or some other case that trigger the 'excess protected frame' need.
> > > So that after your changes it still passes.
> > >
> > > Regards,
> > > Sergos
> > >
> >
> > --
> > Best regards,
> > Sergey Kaplun
--
Best regards,
Sergey Kaplun
next prev parent reply other threads:[~2020-06-09 10:29 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-02 12:19 Sergey Kaplun
2020-06-02 13:51 ` Igor Munkin
2020-06-02 14:16 ` Sergey Kaplun
2020-06-02 14:13 ` Igor Munkin
2020-06-02 15:01 ` Sergey Kaplun
2020-06-02 16:57 ` Sergey Ostanevich
2020-06-05 7:14 ` Sergey Kaplun
2020-06-08 16:35 ` Sergey Ostanevich
2020-06-09 10:29 ` Sergey Kaplun [this message]
2020-06-02 21:28 ` 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=20200609102947.GA10550@root \
--to=skaplun@tarantool.org \
--cc=sergos@tarantool.org \
--cc=tarantool-patches@dev.tarantool.org \
--cc=v.shpilevoy@tarantool.org \
--subject='Re: [Tarantool-patches] [PATCH v2] lua: remove excess Lua call from table encoding' \
/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