Tarantool development patches archive
 help / color / mirror / Atom feed
From: Cyrill Gorcunov <gorcunov@gmail.com>
To: Serge Petrenko <sergepetrenko@tarantool.org>
Cc: tml <tarantool-patches@dev.tarantool.org>,
	Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
Subject: Re: [Tarantool-patches] [PATCH msgpuck 0/2] MP_EXT virtual serializer
Date: Tue, 19 May 2020 12:10:55 +0300	[thread overview]
Message-ID: <CAM5jBj6_8gccseO20O=vNe8Y3QFyvQEU_NZQVZv1wdPTAYmMvQ@mail.gmail.com> (raw)
In-Reply-To: <8292d693-88a3-3c6c-a77e-2da51db0d7dc@tarantool.org>

Reviewed-by: Cyrill Gorcunov <gorcunov@gmail.com>

On Mon, May 18, 2020 at 6:18 PM Serge Petrenko
<sergepetrenko@tarantool.org> wrote:
>
>
> 12.05.2020 02:46, Vladislav Shpilevoy пишет:
> > The patchset makes MP_EXT serializer for mp_snprint() and
> > mp_fprint() functions virtual.
> >
> > The patch implements one possible solution - return recursion
> > instead of mp_stack into the printers, and make external code
> > overload both mp_fprint() and mp_snprint(). The most
> > straightforward solution.
> >
> > However it is possible to avoid overloading both mp_fprint() and
> > mp_snprint(). Instead, msgpuck could expose just one virtual
> > method, which takes an opaque object with method print() having
> > signature like snprintf() and fprintf() - format and arguments.
> >
> > mp_snprint() would create that opaque object's print() method as
> > snprintf(). While mp_fprint() would create this object's print()
> > method as fprintf(). Drawback of the solution - ton of virtual
> > calls, because serializers tend to call print() a lot, on small
> > strings like ':', ', ', and so on. On the other hand, this should
> > simplify code in Tarantool, especially MP_ERROR serializer, where
> > code duplication was so big for mp_snprint_error() and
> > mp_fprint_error(), that I invented some kind of C template for it.
> >
> > With one virtual method, which accepts a virtual object it would
> > be just one mp_print_error().
> >
> > I decided to leave the final decision to a review discussion.
> > Should we keep it like it is done now, or make it even more
> > virtual like I described above, or probably there are other ideas.
> >
> > Branch: http://github.com/tarantool/msgpuck/tree/gerold103/mp_print_ext
> > Issue: https://github.com/tarantool/tarantool/issues/4719
> >
> > Vladislav Shpilevoy (2):
> >    Return recursion to mp_snprint() and mp_fprint()
> >    Make MP_EXT mp_snprint() and mp_fprint() customizable
> >
> >   msgpuck.c      | 156 ++++++++++++++++++++++++++++++++-----------------
> >   msgpuck.h      |  50 ++++++++++++++++
> >   test/msgpuck.c |  83 +++++++++++++++++++++++++-
> >   3 files changed, 234 insertions(+), 55 deletions(-)
>
>
> Hi! Thanks for the patchset! LGTM(including patch 1.5/2)
>
> --
> Serge Petrenko
>

  reply	other threads:[~2020-05-19  9:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-11 23:46 Vladislav Shpilevoy
2020-05-11 23:46 ` [Tarantool-patches] [PATCH msgpuck 1/2] Return recursion to mp_snprint() and mp_fprint() Vladislav Shpilevoy
2020-05-11 23:46 ` [Tarantool-patches] [PATCH msgpuck 2/2] Make MP_EXT mp_snprint() and mp_fprint() customizable Vladislav Shpilevoy
2020-05-19 20:48   ` Vladislav Shpilevoy
2020-05-14 21:26 ` [Tarantool-patches] [PATCH msgpuck 1.5/2] Provide more details at MP_EXT mp_fprint/snprint() Vladislav Shpilevoy
2020-05-19 12:14   ` Alexander Turenko
2020-05-19 20:48     ` Vladislav Shpilevoy
2020-05-18 15:18 ` [Tarantool-patches] [PATCH msgpuck 0/2] MP_EXT virtual serializer Serge Petrenko
2020-05-19  9:10   ` Cyrill Gorcunov [this message]
2020-05-21 18:23 ` Alexander Turenko

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='CAM5jBj6_8gccseO20O=vNe8Y3QFyvQEU_NZQVZv1wdPTAYmMvQ@mail.gmail.com' \
    --to=gorcunov@gmail.com \
    --cc=sergepetrenko@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --cc=v.shpilevoy@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH msgpuck 0/2] MP_EXT virtual serializer' \
    /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