Tarantool development patches archive
 help / color / mirror / Atom feed
From: Igor Munkin <imun@tarantool.org>
To: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH v2 1/3] box: introduce port_c
Date: Fri, 24 Apr 2020 15:22:35 +0300	[thread overview]
Message-ID: <20200424122235.GH11314@tarantool.org> (raw)
In-Reply-To: <4a8497baa0ec66ab6c54207121cd62c3f6071fb0.1587600640.git.v.shpilevoy@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(-)
> 

<snipped>

> 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 <fiber.h>
>  #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)

<snipped>

> -- 
> 2.21.1 (Apple Git-122.3)
> 

-- 
Best regards,
IM

  reply	other threads:[~2020-04-24 12:29 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-23  0:12 [Tarantool-patches] [PATCH v2 0/3] box_return_mp Vladislav Shpilevoy
2020-04-23  0:12 ` [Tarantool-patches] [PATCH v2 1/3] box: introduce port_c Vladislav Shpilevoy
2020-04-24 12:22   ` Igor Munkin [this message]
2020-04-24 22:06     ` Vladislav Shpilevoy
2020-04-23  0:12 ` [Tarantool-patches] [PATCH v2 2/3] box: introduce box_return_mp() public C function Vladislav Shpilevoy
2020-04-24 12:22   ` Igor Munkin
2020-04-27 15:14   ` Nikita Pettik
2020-04-27 21:29     ` Vladislav Shpilevoy
2020-04-27 22:55       ` Nikita Pettik
2020-04-23  0:12 ` [Tarantool-patches] [PATCH v2 3/3] box: replace port_tuple with port_c everywhere Vladislav Shpilevoy
2020-04-25  0:21   ` Igor Munkin
2020-04-26 19:22     ` Vladislav Shpilevoy
2020-04-27  9:12       ` Igor Munkin
2020-04-27  9:18         ` Igor Munkin
2020-04-27 14:10   ` Nikita Pettik
2020-04-28 11:08 ` [Tarantool-patches] [PATCH v2 0/3] box_return_mp Kirill Yukhin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200424122235.GH11314@tarantool.org \
    --to=imun@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --cc=v.shpilevoy@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH v2 1/3] box: introduce port_c' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox