From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id E03486FC8F; Tue, 23 Mar 2021 15:34:25 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org E03486FC8F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1616502866; bh=xP6T5Q/UIX7spvXrdz9i6PKxDlLZhCsuXLdfpdpnr04=; h=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=DMNM+CPNzykFM1E/ILPr+rjQiYGNPkTn5EBVHpWLMsL93rBXtlC44SaHL29fSEPvH J0cb7wiKeJUOQwd9V/+F+vzrcLjqrBWQS//wrTzf9F/4Vca2IeYI5oq514/3qaXo7h uQ6s2TX3YSXdjdC2gpaROsQd0uvWwguH5khiLE9Y= Received: from smtp58.i.mail.ru (smtp58.i.mail.ru [217.69.128.38]) (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 991A36FC8F for ; Tue, 23 Mar 2021 15:34:24 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 991A36FC8F Received: by smtp58.i.mail.ru with esmtpa (envelope-from ) id 1lOgEm-00032U-EP; Tue, 23 Mar 2021 15:34:21 +0300 Date: Tue, 23 Mar 2021 15:34:18 +0300 To: Vladislav Shpilevoy Message-ID: <20210323123418.GA142065@tarantool.org> References: <33f5e67c-5aeb-08d0-08b7-0ce23a0f2791@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <33f5e67c-5aeb-08d0-08b7-0ce23a0f2791@tarantool.org> X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD95D6E7CC48CB1F5F10D3016C09B407F8B1E2E766A3410B623182A05F538085040AE2B2D38C1C66F0BCAC6F1D2E5A6C20DFD92284E6B1C18D7D747BB4D9C156741 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7081BBE264C6D7F42EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006374E88016F1B7D8D248638F802B75D45FF914D58D5BE9E6BC131B5C99E7648C95C686AF563A045C75EDDC625126EF4DAE73E39EE7DD576D581A471835C12D1D9774AD6D5ED66289B5278DA827A17800CE71AE4D56B06699BBC9FA2833FD35BB23D2EF20D2F80756B5F868A13BD56FB6657A471835C12D1D977725E5C173C3A84C34964A708C60C975A117882F4460429728AD0CFFFB425014E868A13BD56FB6657D81D268191BDAD3DC09775C1D3CA48CF9D2E6228E64FB0E6BA3038C0950A5D36C8A9BA7A39EFB766EC990983EF5C0329BA3038C0950A5D36D5E8D9A59859A8B6C896553F6D1FDF8576E601842F6C81A1F004C906525384307823802FF610243DF43C7A68FF6260569E8FC8737B5C2249EC8D19AE6D49635B3BBE47FD9DD3FB59A8DF7F3B2552694A57739F23D657EF2B13377AFFFEAFD26923F8577A6DFFEA7CD1D040B6C1ECEA3F93EC92FD9297F6715571747095F342E857739F23D657EF2BD5E8D9A59859A8B65D56369A3576CBA5089D37D7C0E48F6C5571747095F342E857739F23D657EF2B6825BDBE14D8E70285AA09D4B315C2C6BD9CCCA9EDD067B1EDA766A37F9254B7 X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A2BBE337FB72E92315FF39D8DB89857825EFA8BF88FCBFD63CE0852D54D1EC5181C00AE116A61B0410E0998303CDEDCDDE X-C1DE0DAB: 0D63561A33F958A5EB97427F5C1900576596BA73DB8B9BEAD33B9BAA223715C0D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA7502E6951B79FF9A3F410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D3452F7993FB7281BFD73E379B19E88DFAD7479FB580ECAE3E6D503C158223EDF8F511815545FC433101D7E09C32AA3244CC6E29E6C60221CA1B210B058944BDC3451E887DA02A9F7BF927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojNqBGwjEnRoXoMogPVy2vHQ== X-Mailru-Sender: 5C3750E245F362008BC1685FEC6306EDE325179CBC7E2CAACAC6F1D2E5A6C20DBE4EBEF89FC7D6FA5105BD0848736F9966FEC6BF5C9C28D97E07721503EA2E00ED97202A5A4E92BF7402F9BA4338D657ED14614B50AE0675 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v3 0/2] Encapsulate MEM type changing and checking X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Mergen Imeev via Tarantool-patches Reply-To: Mergen Imeev Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hi! Thank you for the review. My answer below. I already sent you a new version. On Sun, Feb 28, 2021 at 06:35:39PM +0100, Vladislav Shpilevoy wrote: > Hi! Thanks for the patchset! > > On 20.02.2021 17:59, Mergen Imeev via Tarantool-patches wrote: > > This patch-set is part of issue #5818. It changes the way to check and change > > MEM from outside. However, there is almost no changes in functions that work > > with internal structure of MEM, most of which located in vdbemem.c. This will be > > done in another patch-set. > > > > https://github.com/tarantool/tarantool/issues/5818 > > https://github.com/tarantool/tarantool/tree/imeevma/gh-5818-encapsulate-mem-type-checking-and-changing > > > > Changes in v3: > > - Inlined most of the introduced functions to improve performance. > > - Some other fixes in code to improve performance. > > How is this patch related to performance? Isn't it called 'encapsulate'? Not > 'optimize'. > > Or did the non-inlined approach make the performance worse than it is on the > master branch? I see that on the master branch things like mem_set_... are > not inlined and all is fine. > > I have no issues with optimizing it a bit, as long as it does not involve > doing extra actions and does not complicate the code even more. And is not > motivated by introduction of a perf issue in a different place. > > My main concern to the patchset is why do we still have Mem in that scattered > all over the other source files? Can it be extracted into a new file sql/mem.h > and .c? With proper API, separated into public and private. > Done. I moved all MEM-related functions to sql/mem.c ans sqm/mem.h. Rewrote some functions and wrote some new functions. > > Changes in v2: > > - Squashed almost all patches. > > - Review fixes. > > > > Mergen Imeev (2): > > sql: Initialize MEM in sqlVdbeAllocUnpackedRecord() > > sql: Encapsulate MEM type changing and checking > > > > src/box/sql/func.c | 14 +- > > src/box/sql/sqlInt.h | 1 - > > src/box/sql/vdbe.c | 513 ++++++++++++++++++---------------------- > > src/box/sql/vdbeInt.h | 465 +++++++++++++++++++++++++++++++++--- > > src/box/sql/vdbeapi.c | 57 ++--- > > src/box/sql/vdbeaux.c | 360 ++++++++++++++-------------- > > src/box/sql/vdbemem.c | 146 +----------- > > src/box/sql/vdbesort.c | 9 +- > > src/box/sql/vdbetrace.c | 12 +- > > 9 files changed, 874 insertions(+), 703 deletions(-) > >