From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp5.mail.ru (smtp5.mail.ru [94.100.179.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id ECBC9469710 for ; Tue, 9 Jun 2020 13:29:55 +0300 (MSK) Date: Tue, 9 Jun 2020 13:29:47 +0300 From: Sergey Kaplun Message-ID: <20200609102947.GA10550@root> References: <20200602121949.20254-1-skaplun@tarantool.org> <20200602135140.GC5745@tarantool.org> <20200602141636.GA8942@root> <20200602141303.GD5745@tarantool.org> <20200602150104.GA14098@root> <20200602165714.GC50@tarantool.org> <20200605071443.GA5027@root> <20200608163517.GE50@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200608163517.GE50@tarantool.org> Subject: Re: [Tarantool-patches] [PATCH v2] lua: remove excess Lua call from table encoding List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Sergey Ostanevich Cc: tarantool-patches@dev.tarantool.org, Vladislav Shpilevoy 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