emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: emacs-27 9ab85f0 1/3: Fix cl-concatenate (Bug#40180)


From: Noam Postavsky
Subject: Re: emacs-27 9ab85f0 1/3: Fix cl-concatenate (Bug#40180)
Date: Mon, 23 Mar 2020 09:57:50 -0400

On Mon, 23 Mar 2020 at 09:31, Stefan Monnier <address@hidden> 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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]