unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: emacs-27 9ab85f0 1/3: Fix cl-concatenate (Bug#40180)
       [not found] ` <20200323031345.272D320E43@vcs0.savannah.gnu.org>
@ 2020-03-23 13:31   ` Stefan Monnier
  2020-03-23 13:57     ` Noam Postavsky
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Monnier @ 2020-03-23 13:31 UTC (permalink / raw)
  To: emacs-devel; +Cc: Noam Postavsky

>  (defun cl-concatenate (type &rest sequences)
>    "Concatenate, into a sequence of type TYPE, the argument SEQUENCEs.
>  \n(fn TYPE SEQUENCE...)"
> -  (seq-concatenate type sequences))
> +  (apply #'seq-concatenate type sequences))

A `defalias` would be significantly more efficient, no?


        Stefan




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: emacs-27 9ab85f0 1/3: Fix cl-concatenate (Bug#40180)
  2020-03-23 13:31   ` emacs-27 9ab85f0 1/3: Fix cl-concatenate (Bug#40180) Stefan Monnier
@ 2020-03-23 13:57     ` Noam Postavsky
  2020-03-23 23:02       ` Noam Postavsky
  0 siblings, 1 reply; 3+ messages in thread
From: Noam Postavsky @ 2020-03-23 13:57 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Emacs developers

On Mon, 23 Mar 2020 at 09:31, Stefan Monnier <monnier@iro.umontreal.ca> wrote:
>
> >  (defun cl-concatenate (type &rest sequences)
> >    "Concatenate, into a sequence of type TYPE, the argument SEQUENCEs.
> >  \n(fn TYPE SEQUENCE...)"
> > -  (seq-concatenate type sequences))
> > +  (apply #'seq-concatenate type sequences))
>
> A `defalias` would be significantly more efficient, no?

Looks like it saves some garbage, yes.

    (defconst a '(1 2 3))

    (benchmark-run-compiled 100000 (cl-concatenate 'list a a))
    (1.224929595 32 1.3378226840000025)
    (1.2353714580000001 32 1.3444626560000046)
    (1.231527913 32 1.355576149000001)

    (defalias 'cl-concatenate-a 'seq-concatenate)
    (benchmark-run-compiled 100000 (cl-concatenate-a 'list a a))
    (1.040019167 28 1.1824459620000027)
    (1.038810077 28 1.1772625320000003)
    (1.039655252 28 1.1828426319999892)



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: emacs-27 9ab85f0 1/3: Fix cl-concatenate (Bug#40180)
  2020-03-23 13:57     ` Noam Postavsky
@ 2020-03-23 23:02       ` Noam Postavsky
  0 siblings, 0 replies; 3+ messages in thread
From: Noam Postavsky @ 2020-03-23 23:02 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Emacs developers

On Mon, 23 Mar 2020 at 09:57, Noam Postavsky <npostavs@gmail.com> wrote:
>
> On Mon, 23 Mar 2020 at 09:31, Stefan Monnier <monnier@iro.umontreal.ca> wrote:
> >
> > >  (defun cl-concatenate (type &rest sequences)

> > > -  (seq-concatenate type sequences))
> > > +  (apply #'seq-concatenate type sequences))
> >
> > A `defalias` would be significantly more efficient, no?
>
> Looks like it saves some garbage, yes.

Now done in master

[1: 78f76fe16e]: 2020-03-23 18:58:21 -0400
  Make cl-concatenate an alias of seq-concatenate
  https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=78f76fe16e2737b40694f82af28d17a90a21ed7b



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-03-23 23:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20200323031343.771.17929@vcs0.savannah.gnu.org>
     [not found] ` <20200323031345.272D320E43@vcs0.savannah.gnu.org>
2020-03-23 13:31   ` emacs-27 9ab85f0 1/3: Fix cl-concatenate (Bug#40180) Stefan Monnier
2020-03-23 13:57     ` Noam Postavsky
2020-03-23 23:02       ` Noam Postavsky

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).