]> git.eshelyaron.com Git - emacs.git/commit
Faster concat, append, vconcat, copy-sequence, etc
authorMattias Engdegård <mattiase@acm.org>
Fri, 21 Jan 2022 09:00:19 +0000 (10:00 +0100)
committerMattias Engdegård <mattiase@acm.org>
Tue, 25 Jan 2022 14:51:25 +0000 (15:51 +0100)
commit697723b63d69ee6d32a82ab2c88e0ce1e65257ed
tree9d51c5f5deacb49d40833e1ac1e8df0b36ac8600
parentf16039b16120abd0b7e1293292f90d69358e0fef
Faster concat, append, vconcat, copy-sequence, etc

Split the C auxiliary function `concat` into separate functions for
string and list/vector as target types, respectively.  This makes them
simpler and faster.

Implement `Fcopy_sequence` more efficiently for strings, lists and
vectors instead of using `concat`.

The result is a significant performance increase for the Lisp
built-ins concat, append, vconcat, copy-sequence and anything using
them such as mapconcat, copy-alist and propertize.

* src/fns.c (concat2, concat3, Fconcat): Use concat_strings.
(Fappend, Fvconcat): Adapt to changed signature of concat.
(Fcopy_sequence): Faster implementation for lists, strings, and vectors.
(concat_strings): New.
(concat): Strip code for string target, simplify, optimise.
(Fcopy_alist): Use Fcopy_sequence.
src/fns.c