GNU bug report logs -
#78340
[PATCH] New option for comp *.eln file name by the file timestamp of *.el
Previous Next
Reported by: Lin Sun <sunlin7 <at> hotmail.com>
Date: Sat, 10 May 2025 00:14:02 UTC
Severity: normal
Tags: patch
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your message dated Sat, 24 May 2025 12:01:59 +0300
with message-id <861pse2xh4.fsf <at> gnu.org>
and subject line Re: bug#78340: [PATCH] New option for comp *.eln file name by the file timestamp of *.el
has caused the debbugs.gnu.org bug report #78340,
regarding [PATCH] New option for comp *.eln file name by the file timestamp of *.el
to be marked as done.
(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)
--
78340: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=78340
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
[Message part 3 (text/plain, inline)]
Hi,
Currently Emacs with native comp will comp .eln file name by the full context of the .el or .el.gz file in function "comp-el-to-eln-rel-filename".
For example, emacs startup will require the simple.elc, then have to read full of simple.el.gz to calculate the name simple-X-Y.eln.
That's slow on Windows.
This patch introduced a new option "fts" (file time stamp) for "--with-native-compile", it will let the function "comp-el-to-eln-rel-filename" to get the .eln name by reading the .el/.el.gz file timestamp, make emacs faster on Windows. On my Windows testing env, the Emacs startup up time was reduced from 8s to 6.5s with 386 packages, speedup ~20%.
The option can be combined with the exists option "aot", like "--with-native-compile=aot,fts".
This patch is safe for Emacs Windows release, which building with native compile enabled, but does not ship the libgccjit.dll. So the shipped *.eln is like constant files, user won't be able to recompile one; then this patch is safe for the scenario.
Please help review this new option. Thanks
Best Regards
Lin
[0001-New-option-for-comp-.eln-file-name-by-the-file-times.patch (text/x-patch, attachment)]
[Message part 5 (message/rfc822, inline)]
> Cc: acorallo <at> gnu.org, owinebar <at> gmail.com, 78340 <at> debbugs.gnu.org
> Date: Mon, 12 May 2025 22:11:02 +0300
> From: Eli Zaretskii <eliz <at> gnu.org>
>
> > From: Lin Sun <sunlin7 <at> hotmail.com>
> > CC: "acorallo <at> gnu.org" <acorallo <at> gnu.org>, "78340 <at> debbugs.gnu.org"
> > <78340 <at> debbugs.gnu.org>
> > Date: Mon, 12 May 2025 16:38:06 +0000
> > msip_labels:
> >
> > From: Eli Zaretskii <eliz <at> gnu.org>
> > Sent: Monday, May 12, 2025 02:24 PM
> > > ... which will probably be slow on Windows
> > > for the same reason computing the content hash is slow...
> >
> > I want highlight reading a .el file will call windows api OpenFile/ReadFile.../CloseFile.
> > Here is an example that Emacs try to read the .el file to calculate the .eln name, it had called "ReadFile()" 6 time to read full content.
>
> Yes, because Emacs reads files in chunks of 32KB.
>
> > If Emacs uses timestamp, just call Getattribute() function, will reduce counts on windows file api calling.
>
> I tried to explain why relying on time stamps is not reliable enough
> in this case, it brings too high risk of loading an incompatible .eln
> file.
>
> In Emacs, we value correctness before speed.
No further comments, so I'm now closing this bug.
This bug report was last modified 51 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.