From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-f193.google.com (mail-lj1-f193.google.com [209.85.208.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id ACB9B445320 for ; Sat, 11 Jul 2020 00:36:04 +0300 (MSK) Received: by mail-lj1-f193.google.com with SMTP id 9so7996762ljv.5 for ; Fri, 10 Jul 2020 14:36:04 -0700 (PDT) Date: Sat, 11 Jul 2020 00:36:01 +0300 From: Cyrill Gorcunov Message-ID: <20200710213601.GA296695@grain> References: <20200710075605.217824-1-gorcunov@gmail.com> <20200710075605.217824-4-gorcunov@gmail.com> <9c941738-75ce-3357-1bdb-6af6b95a4db6@tarantool.org> <20200710211020.GI1999@grain> <66e76c8e-3c53-9336-9c37-48dee8fefee8@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <66e76c8e-3c53-9336-9c37-48dee8fefee8@tarantool.org> Subject: Re: [Tarantool-patches] [PATCH 3/5] qsync: txn_commit_async -- drop redundant variable List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vladislav Shpilevoy Cc: tml On Fri, Jul 10, 2020 at 11:28:26PM +0200, Vladislav Shpilevoy wrote: > On 10/07/2020 23:10, Cyrill Gorcunov wrote: > > On Fri, Jul 10, 2020 at 10:35:50PM +0200, Vladislav Shpilevoy wrote: > >> Опять же. Патч технически корректен, но так же и бесполезен. > >> Его полезность сравнима с исправлением опечатки в каком-нибудь > >> не особо нужном комменте. Сори, если токсично звучит. > >> > >> Но не вижу в этом патче нужды. > > > > We've to allocate a variable which we simply don't need. Look, > > the former code reads the flag, puts it into variable then > > immediately read it and that's all :/ I think we should not > > spread @is_sync but read the flag as much as possible for > > better grep'ability. > > Do you have a proof that this change improves anything? That > the variable 'allocation' on the stack actually happens, and > costs even 1 ns? You simply don't need it. I think the compiler will rip it off. Again, if you suspect that the code gonna be changed then ignoring the commit is perfectly fine. If not -- the useless variable is just a bad taste at minimum.