On Mon, Jul 8, 2024 at 3:46 PM Eric Sunshine <sunshine@xxxxxxxxxxxxxx> wrote: > On Mon, Jul 8, 2024 at 5:08 AM Jeff King <peff@xxxxxxxx> wrote: > > I took a look at running each test individually. It's surprisingly quite > > a bit slower! About 4s instead of 200ms. > > I'm not surprised. As currently implemented, `make test` chainlints > the self-tests and the Git test scripts unconditionally, even if none > of them have changed. As I understand it, Ævar idea was that the > costly initial `make test` would be offset by subsequent `make test` > invocations since `make` will only recheck the self-test files and Git > test scripts if they have been changed. His particular use-case, as I > recall, was when running the full `make test` repeatedly, such as with > `git rebase --exec 'make test' HEAD~n` to ensure that the entire test > suite passes for each patch of a multi-patch series prior to > submitting the series; the repeated cost of linting unchanged files > adds up, especially when the series is long. By the way, regarding your 4s instead of 200ms result, I don't think that is necessarily reflective of what can be achieved. In particular, to properly measure the effect, you also need to remove all the threading support from chainlint.pl since using "ithreads" adds a not-insignificant amount of time to script startup, especially on Windows, but even on Unix it is quite noticeable. To test this, I think you can just replace this block: unless ($Config{useithreads} && eval { require threads; threads->import(); require Thread::Queue; Thread::Queue->import(); 1; }) { push(@stats, check_script(1, sub { shift(@scripts); }, sub { print(@_); })); show_stats($start_time, \@stats) if $show_stats; exit(exit_code(\@stats)); } with: if (1) { push(@stats, check_script(1, sub { shift(@scripts); }, sub { print(@_); })); show_stats($start_time, \@stats) if $show_stats; exit(exit_code(\@stats)); }