From: daanturo <daanturo@gmail.com>
To: 59692@debbugs.gnu.org
Subject: bug#59692: 29.0.60; Reduce installation size by disabling byte-compilation for some lisp files that won't benefit
Date: Wed, 30 Nov 2022 03:07:47 +0700 [thread overview]
Message-ID: <4bd6a1b7-982e-4593-95dd-2414058e2126@gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 2733 bytes --]
Recently, after each rebuild, I noticed that Emacs' total installation
size has become bigger overtime. That's understandably unavoidable but
there's room for improvement. By analyzing disk usage I discovered
that:
"lisp/leim/"'s compiled elisp files are taking the most significant disk
storage.
By inspecting some of those, I don't think we are able to gain any
practical benefit by compiling them, they don't contain (~)any
function/macro definitions at all.
So I try to disable byte-compilation (by either dir-local vars or
file-local vars) in:
- lisp/leim/ : I disable for the whole directory
And some more .el(s) that I don't find so essential to compile:
- lisp/play/ : not so serious or critical to workflows
- lisp/cedet/{ede,semantic,srecode}/ : we now have LSP/eglot!
- lisp/cedet/{ede.el,semantic.el} : same as above, also a big file by
itself
(I wished pulse.el, mode-local.el, data-debug.el were moved out of this
lisp/cedet/, then putting a single .dir-local.el there would be the
simplest)
- lisp/obsolete/ : already obsolete anyway, but some packages may still
depend on them so no-native-compile only
Then build Emacs again.
The final size of my Emacs installation, compared to before applying
those no-compile local variables:
298.79 MiB -> 253.09 MiB
That's 45.7 MiB disk saved. About 15.3% of total shaved!
Please consider at least "lisp/leim/"'s gigantic files such as
"ZIRANMA.el", "ARRAY30.el", "ja-dic.el" ,etc. as I find those the most
disk-expensive when compiled, yet questionable benefit and waste of time
spending to build.
In GNU Emacs 29.0.60 (build 2, x86_64-pc-linux-gnu, GTK+ Version
3.24.35, cairo version 1.17.6) of 2022-11-30 built on dan-laptop
Repository revision: ec7908204e3d1d415a17813a1fac1a8de334d3b1
Repository branch: makepkg
System Description: Arch Linux
Configured using:
'configure --sysconfdir=/etc --prefix=/usr --libexecdir=/usr/lib
--localstatedir=/var
'--program-transform-name='\''s/\(ctags\)/\1.emacs/'\''' --with-json
--with-libsystemd --with-mailutils --with-modules
--with-native-compilation --with-pgtk --without-xaw3d --with-sound=alsa
--with-tree-sitter --with-xinput2 --with-xwidgets
--with-native-compilation=aot --without-compress-install
'CFLAGS=-march=native -O2 -pipe -fno-plt -fexceptions
-Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security
-fstack-clash-protection -fcf-protection'
LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now'
Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
JSON LCMS2 LIBOTF LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY
PDUMPER PGTK PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF
TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XIM XWIDGETS GTK3 ZLIB
--
Daanturo.
[-- Attachment #2: 0001-No-compile-for-some-lisp-directories-and-files.patch --]
[-- Type: text/x-patch, Size: 3882 bytes --]
From e39138e254a727cbe724760b65bafd551cadcc39 Mon Sep 17 00:00:00 2001
From: Daanturo <daanturo@gmail.com>
Date: Tue, 29 Nov 2022 23:40:19 +0700
Subject: [PATCH] No compile for some lisp directories and files
* lisp/leim/
* lisp/cedet/{ede.el,semantic.el}: produce large compilation output
* lisp/cedet/semantic/
* lisp/cedet/ede/
* lisp/cedet/srecode/
* lisp/play/
* lisp/obsolete/ : only no-native-compile
---
lisp/cedet/ede.el | 4 ++++
lisp/cedet/ede/.dir-locals.el | 4 ++++
lisp/cedet/semantic.el | 4 ++++
lisp/cedet/semantic/.dir-locals.el | 4 ++++
lisp/cedet/srecode/.dir-locals.el | 4 ++++
lisp/leim/.dir-locals.el | 4 ++++
lisp/obsolete/.dir-locals.el | 4 ++++
lisp/play/.dir-locals.el | 4 ++++
8 files changed, 32 insertions(+)
create mode 100644 lisp/cedet/ede/.dir-locals.el
create mode 100644 lisp/cedet/semantic/.dir-locals.el
create mode 100644 lisp/cedet/srecode/.dir-locals.el
create mode 100644 lisp/leim/.dir-locals.el
create mode 100644 lisp/obsolete/.dir-locals.el
create mode 100644 lisp/play/.dir-locals.el
diff --git a/lisp/cedet/ede.el b/lisp/cedet/ede.el
index 1118235757..4fd8be23a9 100644
--- a/lisp/cedet/ede.el
+++ b/lisp/cedet/ede.el
@@ -1539,3 +1539,7 @@ project-root
(ede-speedbar-file-setup))
;;; ede.el ends here
+
+;; Local Variables:
+;; no-byte-compile: t
+;; End:
diff --git a/lisp/cedet/ede/.dir-locals.el b/lisp/cedet/ede/.dir-locals.el
new file mode 100644
index 0000000000..de432a4540
--- /dev/null
+++ b/lisp/cedet/ede/.dir-locals.el
@@ -0,0 +1,4 @@
+;;; Directory Local Variables -*- no-byte-compile: t -*-
+;;; For more information see (info "(emacs) Directory Variables")
+
+((nil . ((no-byte-compile . t))))
diff --git a/lisp/cedet/semantic.el b/lisp/cedet/semantic.el
index adb4705620..e1f78ccf55 100644
--- a/lisp/cedet/semantic.el
+++ b/lisp/cedet/semantic.el
@@ -1134,3 +1134,7 @@ semantic-mode
;; (require 'semantic/load)
;;; semantic.el ends here
+
+;; Local Variables:
+;; no-byte-compile: t
+;; End:
diff --git a/lisp/cedet/semantic/.dir-locals.el b/lisp/cedet/semantic/.dir-locals.el
new file mode 100644
index 0000000000..de432a4540
--- /dev/null
+++ b/lisp/cedet/semantic/.dir-locals.el
@@ -0,0 +1,4 @@
+;;; Directory Local Variables -*- no-byte-compile: t -*-
+;;; For more information see (info "(emacs) Directory Variables")
+
+((nil . ((no-byte-compile . t))))
diff --git a/lisp/cedet/srecode/.dir-locals.el b/lisp/cedet/srecode/.dir-locals.el
new file mode 100644
index 0000000000..de432a4540
--- /dev/null
+++ b/lisp/cedet/srecode/.dir-locals.el
@@ -0,0 +1,4 @@
+;;; Directory Local Variables -*- no-byte-compile: t -*-
+;;; For more information see (info "(emacs) Directory Variables")
+
+((nil . ((no-byte-compile . t))))
diff --git a/lisp/leim/.dir-locals.el b/lisp/leim/.dir-locals.el
new file mode 100644
index 0000000000..de432a4540
--- /dev/null
+++ b/lisp/leim/.dir-locals.el
@@ -0,0 +1,4 @@
+;;; Directory Local Variables -*- no-byte-compile: t -*-
+;;; For more information see (info "(emacs) Directory Variables")
+
+((nil . ((no-byte-compile . t))))
diff --git a/lisp/obsolete/.dir-locals.el b/lisp/obsolete/.dir-locals.el
new file mode 100644
index 0000000000..bb7ef23866
--- /dev/null
+++ b/lisp/obsolete/.dir-locals.el
@@ -0,0 +1,4 @@
+;;; Directory Local Variables -*- no-byte-compile: t -*-
+;;; For more information see (info "(emacs) Directory Variables")
+
+((nil . ((no-native-compile . t))))
diff --git a/lisp/play/.dir-locals.el b/lisp/play/.dir-locals.el
new file mode 100644
index 0000000000..de432a4540
--- /dev/null
+++ b/lisp/play/.dir-locals.el
@@ -0,0 +1,4 @@
+;;; Directory Local Variables -*- no-byte-compile: t -*-
+;;; For more information see (info "(emacs) Directory Variables")
+
+((nil . ((no-byte-compile . t))))
--
2.38.1
next reply other threads:[~2022-11-29 20:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-29 20:07 daanturo [this message]
2022-11-29 20:18 ` bug#59692: 29.0.60; Reduce installation size by disabling byte-compilation for some lisp files that won't benefit Eli Zaretskii
2022-11-30 18:58 ` daanturo
2022-12-13 1:04 ` Stefan Kangas
2022-12-13 6:18 ` daanturo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4bd6a1b7-982e-4593-95dd-2414058e2126@gmail.com \
--to=daanturo@gmail.com \
--cc=59692@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).