emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: master afc0bfd380: Speed up loaddefs-generate on slow disks


From: Stefan Monnier
Subject: Re: master afc0bfd380: Speed up loaddefs-generate on slow disks
Date: Thu, 02 Jun 2022 11:10:32 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

>     Speed up loaddefs-generate on slow disks
[...]
> @@ -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

I'm really surprised this is faster, even on slow disks.
Does anyone have a idea of why that is?

Maybe `file-newer-than-file-p` should accept a time value for one of the
two file names so we can speed this up further by refraining from
constructing a whole `file-attributes` only to reduce it down to
a single boolean?


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]