bug#60807: [PATCH 1/2] mtime: use Time::HiRes::stat when available for subsecond resolution

2023-02-03 Thread Jim Meyering
On Sun, Jan 15, 2023 at 12:27 AM Mike Frysinger wrote: > On 14 Jan 2023 21:27, Jacob Bachmeyer wrote: > > Mike Frysinger wrote: > > > --- a/lib/Automake/FileUtils.pm > > > +++ b/lib/Automake/FileUtils.pm > > > @@ -42,6 +42,11 @@ use Exporter; > > > use File::stat; > > > use IO::File; > > > > >

[bug#60807] [PATCH 1/2] mtime: use Time::HiRes::stat when available for subsecond resolution

2023-01-15 Thread Mike Frysinger
On 14 Jan 2023 21:27, Jacob Bachmeyer wrote: > Mike Frysinger wrote: > > --- a/lib/Automake/FileUtils.pm > > +++ b/lib/Automake/FileUtils.pm > > @@ -42,6 +42,11 @@ use Exporter; > > use File::stat; > > use IO::File; > > > > +# Perl's builtin stat does not provide sub-second resolution. Use >

[bug#60807] [PATCH 1/2] mtime: use Time::HiRes::stat when available for subsecond resolution

2023-01-14 Thread Jacob Bachmeyer
Mike Frysinger wrote: Perl's builtin stat function returns timestamps that have 1 second resolution. This can lead automake needlessly regenerating files because it compares timestamps as "older than or equal to" rather than only "older than". This is perfectly reasonable as we have no way of

[bug#60807] [PATCH 1/2] mtime: use Time::HiRes::stat when available for subsecond resolution

2023-01-14 Thread Mike Frysinger
On 14 Jan 2023 14:52, Karl Berry wrote: > +my $have_time_hires = eval { require Time::HiRes; }; > > I don't object. Although if there's no speed up in practice, I wonder if > it's worth the extra code (simple-enough though it is). -k there's no speed up in the execution of a single process,

[bug#60807] [PATCH 1/2] mtime: use Time::HiRes::stat when available for subsecond resolution

2023-01-14 Thread Karl Berry
+my $have_time_hires = eval { require Time::HiRes; }; I don't object. Although if there's no speed up in practice, I wonder if it's worth the extra code (simple-enough though it is). -k

[bug#60807] [PATCH 1/2] mtime: use Time::HiRes::stat when available for subsecond resolution

2023-01-14 Thread Mike Frysinger
Perl's builtin stat function returns timestamps that have 1 second resolution. This can lead automake needlessly regenerating files because it compares timestamps as "older than or equal to" rather than only "older than". This is perfectly reasonable as we have no way of knowing what file is