From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpng3.m.smailru.net (smtpng3.m.smailru.net [94.100.177.149]) (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 3D0A54696C3 for ; Fri, 24 Apr 2020 15:29:43 +0300 (MSK) Date: Fri, 24 Apr 2020 15:22:35 +0300 From: Igor Munkin Message-ID: <20200424122235.GH11314@tarantool.org> References: <4a8497baa0ec66ab6c54207121cd62c3f6071fb0.1587600640.git.v.shpilevoy@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <4a8497baa0ec66ab6c54207121cd62c3f6071fb0.1587600640.git.v.shpilevoy@tarantool.org> Subject: Re: [Tarantool-patches] [PATCH v2 1/3] box: introduce port_c List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vladislav Shpilevoy Cc: tarantool-patches@dev.tarantool.org Vlad, Thanks for the patch! I left a single nit below, otherwise LGTM. On 23.04.20, Vladislav Shpilevoy wrote: > Port_c is a new descendant of struct port. It is used now for > public C functions to store their result. Currently they can > return only a tuple, but it will change soon, they will be able to > return arbitrary MessagePack. > > Port_tuple is not removed, because still is used for box_select(), > for functional indexes, and in SQL as a base for port_sql. > Although that may be changed later. Functional indexes really need > only a single MessagePack object from their function. While > box_select() working via port_tuple or port_c didn't show any > significant difference during micro benchmarks. > > Part of #4641 > --- > src/box/box.cc | 2 +- > src/box/func.c | 2 +- > src/box/lua/misc.cc | 20 +++++ > src/box/port.c | 206 +++++++++++++++++++++++++++++++++++++++++--- > src/box/port.h | 50 +++++++++++ > src/box/sql/func.c | 22 +++-- > 6 files changed, 281 insertions(+), 21 deletions(-) > > diff --git a/src/box/port.c b/src/box/port.c > index 6e2fe3a6e..2c1fadb5c 100644 > --- a/src/box/port.c > +++ b/src/box/port.c > @@ -37,7 +37,18 @@ > #include > #include "errinj.h" > > -static struct mempool port_tuple_entry_pool; > +/** > + * The pools is used both by port_c and port_tuple, since their Typo: s/is/are/. > + * entires are almost of the same size. Also port_c can use > + * objects from the pool to store result data in their memory, > + * when it fits. > + */ > +static struct mempool port_entry_pool; > + > +enum { > + PORT_ENTRY_SIZE = MAX(sizeof(struct port_c_entry), > + sizeof(struct port_tuple_entry)), > +}; > > int > port_tuple_add(struct port *base, struct tuple *tuple) > -- > 2.21.1 (Apple Git-122.3) > -- Best regards, IM