[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 21:18:57 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) |
Eli Zaretskii [2022-06-02 19:16:00] wrote:
>> > I'm really surprised this is faster, even on slow disks.
>> > Does anyone have a idea of why that is?
> Isn't that clear? file-newer-than-file-p calls 'stat' for both files,
> and one of them is a loop invariant AFAIU. Taking its time outside
> the loop speeds up things (but perhaps not on GNU/Linux).
Under GNU/Linux, I'd expect `stat` to be significantly faster than
`file-attributes` (and the extra `stat` on the loop-invariant file
should be especially fast since it should be as close as it gets w.r.t
the caches (both OS-level and CPU-level)).
>> I didn't actually benchmark it -- either way is fast on my laptop. But
>> the old autoloads code did it with time-less-p, and Eli said that it was
>> faster, so... Perhaps Eli can report back whether it made a difference
>> or not.
> It did -- for the better. Thanks.
This suggests that the kind of change I suggested would make it even
a bit faster, tho it should reduce the run time by less than 50%
under Windows (because the time to do the `stat`s is apparently already
>50% of the total).
Stefan
- Re: master afc0bfd380: Speed up loaddefs-generate on slow disks, Stefan Monnier, 2022/06/02
- Re: master afc0bfd380: Speed up loaddefs-generate on slow disks, Lars Ingebrigtsen, 2022/06/02
- Re: master afc0bfd380: Speed up loaddefs-generate on slow disks, Eli Zaretskii, 2022/06/02
- Re: master afc0bfd380: Speed up loaddefs-generate on slow disks,
Stefan Monnier <=
- Re: master afc0bfd380: Speed up loaddefs-generate on slow disks, Eli Zaretskii, 2022/06/03
- Re: master afc0bfd380: Speed up loaddefs-generate on slow disks, Stefan Monnier, 2022/06/03
- Re: master afc0bfd380: Speed up loaddefs-generate on slow disks, Eli Zaretskii, 2022/06/03
- Re: master afc0bfd380: Speed up loaddefs-generate on slow disks, Stefan Monnier, 2022/06/03
- Re: master afc0bfd380: Speed up loaddefs-generate on slow disks, Eli Zaretskii, 2022/06/03
Re: master afc0bfd380: Speed up loaddefs-generate on slow disks, Lars Ingebrigtsen, 2022/06/04