1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-05 22:20:24 -08:00

Unify constants that are equal-including-properties in compiler

This results in a healthy reduction of .elc file size (> 300 KiB saved)
as well as less memory use.

* lisp/emacs-lisp/bytecomp.el (byte-compile-get-constant):
Use 'equal-including-properties' as equivalence relation for all
constants, not just strings.
* etc/NEWS: Mention it.  Strictly speaking it's not an incompatible
change because it doesn't break any earlier promises, but for people
having code that made incorrect assumptions, this provides a useful
explanation.
This commit is contained in:
Mattias Engdegård 2025-11-02 10:20:47 +01:00
parent ef1dfdc663
commit 8815194ea6
2 changed files with 11 additions and 2 deletions

View file

@ -3049,6 +3049,16 @@ Other functions that use 'aset' to modify string data, such as
'subst-char-in-string' with a non-nil INPLACE argument, will signal an
error if called with arguments that would violate these rules.
+++
** More program constants are combined by the compiler.
The compiler now unifies more constants that are 'equal' for better code
generation. This does not affect correct programs but may expose some
coding mistakes. For example,
(eq (cdr '(1 2 3)) '(2 3)))
may return either nil or t.
** Nested backquotes are not supported any more in Pcase patterns.
---