GNU bug report logs - #78340
[PATCH] New option for comp *.eln file name by the file timestamp of *.el

Previous Next

Package: emacs;

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

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Lin Sun <sunlin7 <at> hotmail.com>
Subject: bug#78340: closed (Re: bug#78340: [PATCH] New option for comp
 *.eln file name by the file timestamp of *.el)
Date: Sat, 24 May 2025 09:03:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#78340: [PATCH] New option for comp *.eln file name by the file timestamp of *.el

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 78340 <at> debbugs.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)]
From: Eli Zaretskii <eliz <at> gnu.org>
To: sunlin7 <at> hotmail.com
Cc: 78340-done <at> debbugs.gnu.org, acorallo <at> gnu.org, owinebar <at> gmail.com
Subject: Re: bug#78340: [PATCH] New option for comp *.eln file name by the file
 timestamp of *.el
Date: Sat, 24 May 2025 12:01:59 +0300
> 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.

[Message part 3 (message/rfc822, inline)]
From: Lin Sun <sunlin7 <at> hotmail.com>
To: "bug-gnu-emacs <at> gnu.org" <bug-gnu-emacs <at> gnu.org>
Subject: [PATCH] New option for comp *.eln file name by the file timestamp of
 *.el
Date: Sat, 10 May 2025 00:07:52 +0000
[Message part 4 (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)]

This bug report was last modified 53 days ago.

Previous Next


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