From g@bembecker @end|ng |rom gm@||@com  Wed Dec  9 18:36:22 2020
From: g@bembecker @end|ng |rom gm@||@com (Gabriel Becker)
Date: Wed, 9 Dec 2020 09:36:22 -0800
Subject: [Rd] [External] Re: New pipe operator
In-Reply-To: <CAP01uRnVnPws==rAAvumKeV0HMqMA3SRWvdyvTA6MXohbLuCXQ@mail.gmail.com>
References: <e55c2093-0bb5-5f9b-5521-0ca8bdf35953@gmail.com>
 <CALyqOb8c1hHOSaMV+fqXTwpeOsP--KJ_t-oeqMYYafVXeNpqZg@mail.gmail.com>
 <7586e034-e287-0970-6480-f82d747b5445@gmail.com>
 <CADfFDC7bT58_+52uvmpHuMMQRNbbmqV3_7t_fc4sgJ_Esw=xag@mail.gmail.com>
 <CAJmOi+PO_8XDC23=rT=pQ76ENL=gx2V-41ax2fHSVs87xURcEA@mail.gmail.com>
 <alpine.DEB.2.21.2012051203250.3003@luke-Latitude-7480>
 <CAOO9MKU7LD9JkX3XK3NpqzzpiTirvRxdqJBbX0D=W3ik+Fw0bw@mail.gmail.com>
 <1e755fbb-f18f-227e-3477-6467fc255cbf@gmail.com>
 <CAP01uRnVnPws==rAAvumKeV0HMqMA3SRWvdyvTA6MXohbLuCXQ@mail.gmail.com>
Message-ID: <CAD4oTHE+6q5S11tJRvEiH1ZPjDFGwJ+s5WyyRCAsPrTxjLSwrw@mail.gmail.com>

On Wed, Dec 9, 2020 at 8:26 AM Gabor Grothendieck <ggrothendieck at gmail.com>
wrote:

> On Wed, Dec 9, 2020 at 10:08 AM Duncan Murdoch <murdoch.duncan at gmail.com>
> wrote:
> >
> > You might be interested in this blog post by Michael Barrowman:
> >
> > https://michaelbarrowman.co.uk/post/the-new-base-pipe/
> >
> > He does some timing comparisons, and the current R-devel implementations
> > of |> and \() do quite well.
>
> It does bring out that the requirement of using functions to get around the
> lack of placeholders is not free but exacts a small penalty in
> terms of performance (in addition to verbosity).
>

I mean, technically, yes, but even with that overhead it's 2 *orders of
magnitude* faster than the magrittr you're used to, and by the look of it
~3x faster than the new magrittr. And, those base pipe speeds are in
microseconds. You'd have to be running that pipeline thousands of times -
which people don't generally do with pipelines in the first place -  to see
a *5 millisecond* slowdown, which you would then happily fail to notice
completely because what your pipeline is actually doing takes so much
longer than those microseconds of the extra function call that its unlikely
to be detectable at all.



The bizarro pipe supports placeholders and so doesn't require functions
> as a workaround and thus would presumably be even faster.  It is also
> perfectly consistent with the rest of R and requires no new syntax.
> You have to explicitly add a dot as the first argument but this seems a
> better
> compromise to me than those involved with |> .
>

I mean, I think the bizarro pipe was a pretty clever piece of work. I was
impressed by what John did there, but I don't really know what you're
suggesting here. As you say, the bizarro pipe works now without any changes
and you're welcome to use it if you prefer it to base's (proposed/likely)
|> and magrittr's %>%.

~G

>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

	[[alternative HTML version deleted]]



[Rd] [External] Re: New pipe operator
Gabriel Becker