emacs-devel
[Top][All Lists]
Advanced

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

Re: Time resolution in Emacs


From: Max Nikulin
Subject: Re: Time resolution in Emacs
Date: Mon, 25 Apr 2022 23:54:58 +0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0

On 25/04/2022 22:34, Paul Eggert wrote:
On 4/22/22 23:51, Eli Zaretskii wrote:

There are Gnulib library functions to
deal with this sort of thing; it's not a new problem.

Doesn't that slow down applications?

Not significantly, no. file-attributes already has the file's filesystem ID and timestamps so Emacs can easily cache that (it's a small cache with only one entry per filesystem). There's no need to traipse through the filesystem looking at other files. This is what coreutils does and it works well in practice. It's not expensive and not that complicated.

Your suggestion of maintaining a static table for known filesystem types is a good one; we could do that to improve common cases. I would like to take a look into doing this.

Notice that on Linux while file metadata are in cache, timestamps may have high time resolution. When later fetched from disk they may have coarse resolution, e.g. whole seconds.

Generally it is fragile to rely on file modification time. That is why build systems relying of file hashes appeared.

As to 16ms resolution, at least for `benchmark-run' I would like to have finer granularity.

On the other hand, when higher timer frequency is required, from my point of view, it may be better to run such application in a separate process.



reply via email to

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