From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Newsgroups: gmane.emacs.bugs Subject: bug#38708: [PATCH] Deduplicate flonum and bignum constants in bytecode Date: Sun, 22 Dec 2019 17:42:50 +0100 Message-ID: Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Content-Type: multipart/mixed; boundary="Apple-Mail=_B265F063-E22A-4E8F-9A93-8DD711029456" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="131993"; mail-complaints-to="usenet@blaine.gmane.org" To: 38708@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Dec 22 18:11:21 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1ij4lE-000YC3-BD for geb-bug-gnu-emacs@m.gmane.org; Sun, 22 Dec 2019 18:11:20 +0100 Original-Received: from localhost ([::1]:49492 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ij4lC-0001Wh-Ru for geb-bug-gnu-emacs@m.gmane.org; Sun, 22 Dec 2019 12:11:18 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56608) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ij4kx-0001WC-7F for bug-gnu-emacs@gnu.org; Sun, 22 Dec 2019 12:11:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ij4kw-000733-2e for bug-gnu-emacs@gnu.org; Sun, 22 Dec 2019 12:11:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44209) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ij4kv-00071v-RX for bug-gnu-emacs@gnu.org; Sun, 22 Dec 2019 12:11:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ij4kv-0001dd-NF for bug-gnu-emacs@gnu.org; Sun, 22 Dec 2019 12:11:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 22 Dec 2019 17:11:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 38708 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.15770346206209 (code B ref -1); Sun, 22 Dec 2019 17:11:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 22 Dec 2019 17:10:20 +0000 Original-Received: from localhost ([127.0.0.1]:50182 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ij4kG-0001c4-1N for submit@debbugs.gnu.org; Sun, 22 Dec 2019 12:10:20 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:47817) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ij4kE-0001bv-PH for submit@debbugs.gnu.org; Sun, 22 Dec 2019 12:10:19 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54291) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ij4kD-0001LS-Fq for bug-gnu-emacs@gnu.org; Sun, 22 Dec 2019 12:10:18 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ij4kB-0004Qp-IW for bug-gnu-emacs@gnu.org; Sun, 22 Dec 2019 12:10:17 -0500 Original-Received: from mail1461c50.megamailservers.eu ([91.136.14.61]:39300 helo=mail267c50.megamailservers.eu) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ij4kA-0004GQ-RK for bug-gnu-emacs@gnu.org; Sun, 22 Dec 2019 12:10:15 -0500 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1577032973; bh=0o2Pi3FbnjGqxKS6oNdkN++eT9dyFi9L4Qza93RWA1s=; h=From:Subject:Date:To:From; b=sQ/1/wUk0fE9zgBXVdPsYRxmQn3UY4XcxldiUBi+o61GXn03KI341jK4vLmkP9x+q 0j/f0apPbZTgrh7ZmS/iXdTLOthmes4J0hsxlNsWlRaq6TNeA4TagR3BrmpNOAfn9M PntsrOATodMcB2CIriuF14ElfpuersGJS4R5CXKI= Feedback-ID: mattiase@acm.or Original-Received: from [192.168.0.4] (c188-150-171-71.bredband.comhem.se [188.150.171.71]) (authenticated bits=0) by mail267c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id xBMGgp5n029957 for ; Sun, 22 Dec 2019 16:42:53 +0000 X-Mailer: Apple Mail (2.3445.104.11) X-CTCH-RefID: str=0001.0A0B020E.5DFF9D0D.000E, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: 0.000 X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=OY7m8SbY c=1 sm=1 tr=0 a=SF+I6pRkHZhrawxbOkkvaA==:117 a=SF+I6pRkHZhrawxbOkkvaA==:17 a=M51BFTxLslgA:10 a=mE8gq1b1v8SMOlwpS_UA:9 a=CjuIK1q_8ugA:10 a=W5df0rz_QW9IkWv8V2MA:9 a=B2y7HmGcmWMA:10 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] [fuzzy] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:173642 Archived-At: --Apple-Mail=_B265F063-E22A-4E8F-9A93-8DD711029456 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Minor improvement to avoid duplication of some numbers in bytecode. No significant degradation in compilation speed observed. The savings = aren't huge either: 1382 bytes in all .elc files, but the in-memory = savings are probably higher, since an extra small flonum (1.0, say) only = costs 4 bytes in the .elc file, but something like 16-24 bytes in memory = (pointer + boxed flonum). --Apple-Mail=_B265F063-E22A-4E8F-9A93-8DD711029456 Content-Disposition: attachment; filename=0001-Deduplicate-non-fixnum-numeric-constants-in-byte-com.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="0001-Deduplicate-non-fixnum-numeric-constants-in-byte-com.patch" Content-Transfer-Encoding: quoted-printable =46rom=209c2b6e940d9fd6db189c52b92c60ed3a3fb7dfd4=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20=3D?UTF-8?q?Mattias=3D20Engdeg=3DC3=3DA5rd?=3D=20= =0ADate:=20Sun,=2022=20Dec=202019=2012:09:06=20+0100=0A= Subject:=20[PATCH]=20Deduplicate=20non-fixnum=20numeric=20constants=20in=20= byte-compilation=0A=0A*=20lisp/emacs-lisp/bytecomp.el=20= (byte-compile-get-constant):=0AUse=20eql=20for=20looking=20up=20= constants=20instead=20of=20eq,=20allowing=0Afor=20bignum=20and=20flonum=20= deduplication.=0A---=0A=20lisp/emacs-lisp/bytecomp.el=20|=202=20+-=0A=20= 1=20file=20changed,=201=20insertion(+),=201=20deletion(-)=0A=0Adiff=20= --git=20a/lisp/emacs-lisp/bytecomp.el=20b/lisp/emacs-lisp/bytecomp.el=0A= index=20118356ec26..60dbae1d4b=20100644=0A---=20= a/lisp/emacs-lisp/bytecomp.el=0A+++=20b/lisp/emacs-lisp/bytecomp.el=0A@@=20= -3462,7=20+3462,7=20@@=20byte-compile-get-constant=0A=20=09=20=20=20=20=20= =20=20(if=20(equal-including-properties=20(car=20elt)=20,const)=0A=20=09=09= =20=20=20(setq=20result=20elt)))=0A=20=09=20=20=20=20=20result)=0A-=09=20= (assq=20,const=20byte-compile-constants))=0A+=09=20(assoc=20,const=20= byte-compile-constants=20#'eql))=0A=20=20=20=20=20=20=20=20(car=20(setq=20= byte-compile-constants=0A=20=09=09=20=20(cons=20(list=20,const)=20= byte-compile-constants)))))=0A=20=0A--=20=0A2.21.0=20(Apple=20Git-122.2)=0A= =0A= --Apple-Mail=_B265F063-E22A-4E8F-9A93-8DD711029456--