unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org,  Paul Eggert <eggert@cs.ucla.edu>
Subject: Re: master afc0bfd380: Speed up loaddefs-generate on slow disks
Date: Sat, 04 Jun 2022 15:01:50 +0200	[thread overview]
Message-ID: <87ee047fb5.fsf@gnus.org> (raw)
In-Reply-To: <87a6avccs4.fsf@gnus.org> (Lars Ingebrigtsen's message of "Thu, 02 Jun 2022 17:20:43 +0200")

Lars Ingebrigtsen <larsi@gnus.org> writes:

>> 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?
>
> There's a longer discussion about these issues (i.e., reworking the
> functions in this area to be more efficient in these respects) in the
> bug tracker somewhere.  Paul had a bunch of ideas that I think we should
> pursue.  I forget which bug# -- perhaps Paul remembers; added to the CCs.

It's bug#55163, but to recap shortly (hehe) for new readers:

Our time functions return time values on a very inefficient format (a
four-element list), and we want to move (long term) to a more efficient
format (which is a single cons cell).  But we can't just change the
output from our current time functions, because that breaks a lot of
callers.  But we can introduce new functions that only return the
efficient format.

My point in bug#55163 is that we should see this as an opportunity to
overhaul functions in this area in general, and `file-attributes' is one
of those.  For instance, we could have a new function `file-attribute'
where you specify the data you actually want, like
(file-attribute file :modtime), and it'd just return that value.  (Or
more values if you say (file-attribute file :modtime :directoryp) etc.)

If we had that, our loop here would have been

(time-less-p output-time (file-attribute file :modtime))

and it would be maximally fast and efficient.

So I don't think we should touch `file-newer-than-file-p' in any way,
but instead wait for this new set of functions (which should be created
in one go so that everything fits together, and not piecemeal).

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



  parent reply	other threads:[~2022-06-04 13:01 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <165416120601.23485.9799765950267646757@vcs2.savannah.gnu.org>
     [not found] ` <20220602091326.514E9C009A8@vcs2.savannah.gnu.org>
2022-06-02 15:10   ` master afc0bfd380: Speed up loaddefs-generate on slow disks Stefan Monnier
2022-06-02 15:20     ` Lars Ingebrigtsen
2022-06-02 16:16       ` Eli Zaretskii
2022-06-03  1:18         ` Stefan Monnier
2022-06-03  5:52           ` Eli Zaretskii
2022-06-03 12:21             ` Stefan Monnier
2022-06-03 13:05               ` Eli Zaretskii
2022-06-03 13:09                 ` Stefan Monnier
2022-06-03 13:37                   ` Eli Zaretskii
2022-06-04 12:30       ` Lars Ingebrigtsen
2022-06-05 10:06         ` Mattias Engdegård
2022-06-05 14:08           ` Lars Ingebrigtsen
2022-06-06 11:26           ` Lars Ingebrigtsen
2022-06-06 12:01             ` Alan Mackenzie
2022-06-06 12:05               ` Lars Ingebrigtsen
2022-06-06 12:08             ` Lars Ingebrigtsen
2022-06-06 12:16               ` Mattias Engdegård
2022-06-06 12:32                 ` Lars Ingebrigtsen
2022-06-08 11:01                 ` Lars Ingebrigtsen
2022-06-06 12:18               ` Andreas Schwab
2022-06-06 12:28                 ` Lars Ingebrigtsen
2022-06-04 13:01       ` Lars Ingebrigtsen [this message]
2022-06-02 16:16     ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ee047fb5.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=eggert@cs.ucla.edu \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).