GNU bug report logs - #38619
Byte compilation of Emacs autoloads

Previous Next

Package: guix-patches;

Reported by: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Date: Sun, 15 Dec 2019 04:31:02 UTC

Severity: normal

Done: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 38619 in the body.
You can then email your comments to 38619 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#38619; Package guix-patches. (Sun, 15 Dec 2019 04:31:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Maxim Cournoyer <maxim.cournoyer <at> gmail.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Sun, 15 Dec 2019 04:31:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: guix-patches <guix-patches <at> gnu.org>
Subject: Byte compilation of Emacs autoloads
Date: Sun, 15 Dec 2019 13:30:36 +0900
[Message part 1 (text/plain, inline)]
Hello,

The following adds support for byte compiling the generated autoload
files as well as the site-lisp directory of Emacs (the one containing
the site-start.el and guix-emacs.el files).

The performance gain is roughly 30%, as expected for byte compiled
Elisp.  The following command was used for benchmarking:

--8<---------------cut here---------------start------------->8---
./pre-inst-env guix environment -v 10 -m ~/100-emacs-packages-manifest.scm -- emacs -Q --batch --eval "(progn (require 'guix-emacs) (message \"%s\" (benchmark-run-compiled 10 (guix-emacs-autoload-packages))))"
--8<---------------cut here---------------end--------------->8---

It loads the autoloads of ~100 Emacs packages 10 times (~1000 autoloads
files).  The manifest file 100-emacs-packages-manifest.scm is attached.
[100-emacs-packages-manifest.scm (application/octet-stream, attachment)]
[Message part 3 (text/plain, inline)]
The above command for Guix before the changes (commit e19a539):

--8<---------------cut here---------------start------------->8---
[...]
Loading /gnu/store/lj09yx56hgsq9l4ajk5wlxsk4vbrympk-profile/share/emacs/site-lisp/undercover-autoloads.el (source)...
Loading /gnu/store/lj09yx56hgsq9l4ajk5wlxsk4vbrympk-profile/share/emacs/site-lisp/with-editor-autoloads.el (source)...
Loading /gnu/store/lj09yx56hgsq9l4ajk5wlxsk4vbrympk-profile/share/emacs/site-lisp/ws-butler-autoloads.el (source)...
Loading /gnu/store/lj09yx56hgsq9l4ajk5wlxsk4vbrympk-profile/share/emacs/site-lisp/yasnippet-autoloads.el (source)...
(9.971024566 159 2.763721703999999)
--8<---------------cut here---------------end--------------->8---

After the changes:

--8<---------------cut here---------------start------------->8---
Loading /gnu/store/fwji52vg31xmdkc2z5cbjrfza7fxndr5-profile/share/emacs/site-lisp/undercover-autoloads...
Loading /gnu/store/fwji52vg31xmdkc2z5cbjrfza7fxndr5-profile/share/emacs/site-lisp/with-editor-autoloads...
Loading /gnu/store/fwji52vg31xmdkc2z5cbjrfza7fxndr5-profile/share/emacs/site-lisp/ws-butler-autoloads...
Loading /gnu/store/fwji52vg31xmdkc2z5cbjrfza7fxndr5-profile/share/emacs/site-lisp/yasnippet-autoloads...
(7.435941036 143 2.406266451999999)
--8<---------------cut here---------------end--------------->8---

I think it's neat that all of our Elisp is byte compiled; it's something
that can be done without fear on Guix, given that when the Emacs package itself
changes, all the Emacs packages are rebuilt.  It could also find issues we'd not
know existed otherwise, as I found out for the emacs-cl-generic package.

[0001-gnu-emacs-Byte-compile-the-site-lisp-directory.patch (text/x-patch, attachment)]
[0002-emacs-build-system-Byte-compile-the-autoload-files.patch (text/x-patch, attachment)]
[0003-gnu-emacs-cl-generic-Disable-byte-compilation-of-its.patch (text/x-patch, attachment)]
[Message part 7 (text/plain, inline)]
Maxim

Information forwarded to guix-patches <at> gnu.org:
bug#38619; Package guix-patches. (Thu, 27 Feb 2020 10:16:01 GMT) Full text and rfc822 format available.

Message #8 received at 38619 <at> debbugs.gnu.org (full text, mbox):

From: Pierre Neidhardt <mail <at> ambrevar.xyz>
To: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Cc: 38619 <at> debbugs.gnu.org
Subject: Re: [bug#38619] Byte compilation of Emacs autoloads
Date: Thu, 27 Feb 2020 11:15:27 +0100
[Message part 1 (text/plain, inline)]
This is super cool!
Anything blocking this?

-- 
Pierre Neidhardt
https://ambrevar.xyz/
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#38619; Package guix-patches. (Thu, 27 Feb 2020 14:40:02 GMT) Full text and rfc822 format available.

Message #11 received at 38619 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Pierre Neidhardt <mail <at> ambrevar.xyz>
Cc: 38619 <at> debbugs.gnu.org
Subject: Re: [bug#38619] Byte compilation of Emacs autoloads
Date: Thu, 27 Feb 2020 09:39:41 -0500
Pierre Neidhardt <mail <at> ambrevar.xyz> writes:

> This is super cool!
> Anything blocking this?

Testing? :-)

Maxim




Information forwarded to guix-patches <at> gnu.org:
bug#38619; Package guix-patches. (Thu, 27 Feb 2020 21:55:02 GMT) Full text and rfc822 format available.

Message #14 received at 38619 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Pierre Neidhardt <mail <at> ambrevar.xyz>
Cc: 38619 <at> debbugs.gnu.org
Subject: Re: [bug#38619] Byte compilation of Emacs autoloads
Date: Thu, 27 Feb 2020 16:53:52 -0500
[Message part 1 (text/plain, inline)]
Hello Pierre,

Pierre Neidhardt <mail <at> ambrevar.xyz> writes:

I've now tested this change with the extensive manifest (attached).

I've built two profiles, like this:

(before change)
./pre-inst-env guix package -m emacs-pkg.txt -p /tmp/emacs-ref

(after change)
./pre-inst-env guix package -m emacs-pkg.txt -p /tmp/emacs-byte-compiled

Then proceeded to benchmark them like:

--8<---------------cut here---------------start------------->8---
env -i sh -c "source /tmp/emacs-ref/etc/profile && time emacs --batch --eval '()'"
--8<---------------cut here---------------end--------------->8---

Which returned:

--8<---------------cut here---------------start------------->8---
Loading /gnu/store/ipfaivbqjxfnda970w558vpihd84lqwi-profile/share/emacs/site-lisp/treepy-autoloads.el (source)...
Loading /gnu/store/ipfaivbqjxfnda970w558vpihd84lqwi-profile/share/emacs/site-lisp/ts-autoloads.el (source)...
Loading /gnu/store/ipfaivbqjxfnda970w558vpihd84lqwi-profile/share/emacs/site-lisp/tuareg-autoloads.el (source)...
Eager macro-expansion failure: (file-missing "Searching for program" "No such file or directory" "git")
Searching for program: No such file or directory, git

real    0m0.406s
user    0m0.361s
sys     0m0.044s
--8<---------------cut here---------------end--------------->8---

Now with the patches here:
--8<---------------cut here---------------start------------->8---
Loading /gnu/store/l09fascj5xjhbgi3nzc1bhrprdy44y9g-profile/share/emacs/site-lisp/treepy-autoloads...
Loading /gnu/store/l09fascj5xjhbgi3nzc1bhrprdy44y9g-profile/share/emacs/site-lisp/ts-autoloads...
Loading /gnu/store/l09fascj5xjhbgi3nzc1bhrprdy44y9g-profile/share/emacs/site-lisp/tuareg-autoloads.el (source)...
Eager macro-expansion failure: (file-missing "Searching for program" "No such file or directory" "git")
Searching for program: No such file or directory, git

real    0m0.287s
user    0m0.251s
sys     0m0.036s
--8<---------------cut here---------------end--------------->8---

That's a decent speedup :-)

I'll push this to master shortly.

Maxim

[emacs-pkg.txt (text/plain, attachment)]
[0001-gnu-emacs-Byte-compile-the-site-lisp-directory.patch (text/x-patch, attachment)]
[0002-emacs-build-system-Byte-compile-the-autoload-files.patch (text/x-patch, attachment)]
[0003-gnu-emacs-Fix-comment.patch (text/x-patch, attachment)]
[0004-gnu-emacs-cl-generic-Disable-byte-compilation-of-its.patch (text/x-patch, attachment)]
[0005-gnu-emacs-sly-macrostep-Remove-the-enable-autoloads-.patch (text/x-patch, attachment)]
[0006-gnu-emacs-sly-quicklisp-Remove-the-enable-autoloads-.patch (text/x-patch, attachment)]
[0007-gnu-emacs-sly-named-readtables-Disable-byte-compilat.patch (text/x-patch, attachment)]
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#38619; Package guix-patches. (Fri, 28 Feb 2020 07:04:01 GMT) Full text and rfc822 format available.

Message #17 received at 38619 <at> debbugs.gnu.org (full text, mbox):

From: Pierre Neidhardt <mail <at> ambrevar.xyz>
To: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Cc: 38619 <at> debbugs.gnu.org
Subject: Re: [bug#38619] Byte compilation of Emacs autoloads
Date: Fri, 28 Feb 2020 08:03:42 +0100
[Message part 1 (text/plain, inline)]
Hi Maxim,

Maxim Cournoyer <maxim.cournoyer <at> gmail.com> writes:

> Eager macro-expansion failure: (file-missing "Searching for program" "No such file or directory" "git")
> Searching for program: No such file or directory, git

What's up with that?  Is this an problem in one of our packages?

>   ; "emacs-edbi" ;build fails
>   ; "emacs-edbi-sqlite" ;(depends on emacs-edbi)

I might have packaged these some time back.
I'll see if I can fix them.

Cheers!

-- 
Pierre Neidhardt
https://ambrevar.xyz/
[signature.asc (application/pgp-signature, inline)]

Reply sent to Maxim Cournoyer <maxim.cournoyer <at> gmail.com>:
You have taken responsibility. (Fri, 28 Feb 2020 13:27:01 GMT) Full text and rfc822 format available.

Notification sent to Maxim Cournoyer <maxim.cournoyer <at> gmail.com>:
bug acknowledged by developer. (Fri, 28 Feb 2020 13:27:01 GMT) Full text and rfc822 format available.

Message #22 received at 38619-done <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Pierre Neidhardt <mail <at> ambrevar.xyz>
Cc: 38619-done <at> debbugs.gnu.org
Subject: Re: [bug#38619] Byte compilation of Emacs autoloads
Date: Fri, 28 Feb 2020 13:25:50 +0000
Hi Pierre!

On February 28, 2020 7:03:42 AM UTC, Pierre Neidhardt <mail <at> ambrevar.xyz> wrote:
>Hi Maxim,
>
>Maxim Cournoyer <maxim.cournoyer <at> gmail.com> writes:
>
>> Eager macro-expansion failure: (file-missing "Searching for program"
>"No such file or directory" "git")
>> Searching for program: No such file or directory, git
>
>What's up with that?  Is this an problem in one of our packages?

It looks like evaluating the emacs-tuareg autoload file causes the message to be emitted. I'd look this way.

>>   ; "emacs-edbi" ;build fails
>>   ; "emacs-edbi-sqlite" ;(depends on emacs-edbi)

If I'm not mistaken, Efraim promptly fixed those already, after I reported it.

I'm closing this bug, since the changes have been merged to master.

Enjoy!

Maxim




Information forwarded to guix-patches <at> gnu.org:
bug#38619; Package guix-patches. (Fri, 28 Feb 2020 13:39:02 GMT) Full text and rfc822 format available.

Message #25 received at 38619-done <at> debbugs.gnu.org (full text, mbox):

From: Pierre Neidhardt <mail <at> ambrevar.xyz>
To: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Cc: 38619-done <at> debbugs.gnu.org
Subject: Re: [bug#38619] Byte compilation of Emacs autoloads
Date: Fri, 28 Feb 2020 14:38:02 +0100
[Message part 1 (text/plain, inline)]
Thanks a lot!

-- 
Pierre Neidhardt
https://ambrevar.xyz/
[signature.asc (application/pgp-signature, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 28 Mar 2020 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 22 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.