From afc0bfd38076d8184c506d3f3c2e9f4313103c1b Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Thu, 2 Jun 2022 11:13:08 +0200 Subject: [PATCH] Speed up loaddefs-generate on slow disks * lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate): Make file update comparisons faster. --- lisp/emacs-lisp/loaddefs-gen.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lisp/emacs-lisp/loaddefs-gen.el b/lisp/emacs-lisp/loaddefs-gen.el index e5a5c21d234..46aec173e86 100644 --- a/lisp/emacs-lisp/loaddefs-gen.el +++ b/lisp/emacs-lisp/loaddefs-gen.el @@ -522,11 +522,15 @@ If INCLUDE-PACKAGE-VERSION, include package version data." (byte-compile-info (concat "Scraping files for loaddefs")) 0 (length files) nil 10)) + (output-time + (file-attribute-modification-time (file-attributes output-file))) (file-count 0)) (dolist (file files) (progress-reporter-update progress (setq file-count (1+ file-count))) (when (or (not updating) - (file-newer-than-file-p file output-file)) + (time-less-p output-time + (file-attribute-modification-time + (file-attributes file)))) (setq defs (nconc (loaddefs-generate--parse-file file output-file -- 2.39.2