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 A808546971A for ; Fri, 13 Dec 2019 17:15:22 +0300 (MSK) Received: by mail-lj1-f193.google.com with SMTP id c19so2773612lji.11 for ; Fri, 13 Dec 2019 06:15:22 -0800 (PST) Date: Fri, 13 Dec 2019 17:15:20 +0300 From: Konstantin Osipov Message-ID: <20191213141520.GA14414@atlas> References: <0a6806665bbc165dffc23967be57135a46bbad62.1574277369.git.korablev@tarantool.org> <20191204115954.GM6592@atlas> <20191213135638.GA92278@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191213135638.GA92278@tarantool.org> Subject: Re: [Tarantool-patches] [PATCH v2 11/16] sql: introduce sql_stmt_sizeof() function List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Nikita Pettik Cc: tarantool-patches@dev.tarantool.org, v.shpilevoy@tarantool.org * Nikita Pettik [19/12/13 16:59]: > > I would add size-caching right away, to make this function cheap. > > > > if (size != 0) > > return size; > > Does it make any sense? Now for one VM instance it can be called at > most three times: twice during insertion and once during deletion. This will make the contract this function provides more reliable. Please keep in mind that whoever is going to use it in the future will not read its code and not want to think about its complexity. And the added cost will be hard to notice during a code review. So it's less about performance and more about maintenance costs. -- Konstantin Osipov, Moscow, Russia