diff options
author | Mike Frysinger <vapier@gentoo.org> | 2022-02-12 03:41:06 -0500 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2022-02-13 01:44:03 -0500 |
commit | 720a1153134b833de9298927a432b4ea266216fb (patch) | |
tree | 69c16322d9b0530f1ecbc87e684c5eca86fecb55 /NEWS | |
parent | be55eaaa0bae0d6def92d5720b0e81f1d21a9db2 (diff) | |
download | automake-720a1153134b833de9298927a432b4ea266216fb.tar.gz |
m4: speed up filesystem modification checks
The current code sleeps at least 1 second to make sure the generated
files are strictly newer than the source files. It does this for a
few reasons: POSIX only guarantees that `sleep` accept integers, and
filesystems have a history (c.f. Windows) of bad timestamp resolution.
For the first part, we can easily probe sleep to see if it accepts a
decimal number with a fractional part -- just run `sleep 0.001`.
For the second part, we can create two files and then run sleep in a
loop to see when one is considered newer than the other.
For many projects, this 1 second delay is largely amortized by the
rest of the configure script. Autoconf lends itself to being both
large & slow. But in projects with many smallish configure scripts
with many cached vars, the time to rerun is dominated by this single
sleep call. For example, building libgloss against a compiler with
many (60+) multilib configurations, we see:
[Using sleep 1]
$ time ./config.status
real 2m28.164s
user 0m33.651s
sys 0m9.083s
[Using sleep 0.1]
$ time ./config.status
real 0m39.569s
user 0m33.517s
sys 0m8.969s
And in case anyone wonders, going below 0.1s doesn't seem to make a
statistically significant difference, at least in this configuration.
It appears to be within "noise" limits.
[Using sleep 0.001]
$ time ./config.status
real 0m39.760s
user 0m33.342s
sys 0m9.080s
* NEWS: Mention updated timestamp checking.
* m4/sanity.m4: Determine whether `sleep` accepts fractional seconds.
Determine (roughly) the filesystem timestamp resolution. Use this to
sleep less when waiting for generated file timestamps to update.
Diffstat (limited to 'NEWS')
-rw-r--r-- | NEWS | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -19,6 +19,9 @@ New in 1.17: - AM_TEXI2FLAGS may be defined to pass extra flags to TEXI2DVI & TEXI2PDF. + - Generated file timestamp checks now handle filesystems with sub-second + timestamp granularity dynamically. + * Obsolescent features: - py-compile no longer supports Python 0.x or 1.x versions. Python 2.0, |