]> git.eshelyaron.com Git - emacs.git/commitdiff
Speed up loaddefs-generate on slow disks
authorLars Ingebrigtsen <larsi@gnus.org>
Thu, 2 Jun 2022 09:13:08 +0000 (11:13 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Thu, 2 Jun 2022 09:13:20 +0000 (11:13 +0200)
* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate): Make file
update comparisons faster.

lisp/emacs-lisp/loaddefs-gen.el

index e5a5c21d234fdecd5a4e720ee81d2dc92f5c285b..46aec173e86e72029d2705d0a122b473adaed627 100644 (file)
@@ -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