develooper Front page | perl.perl5.changes | Postings from May 2020

[Perl/perl5] 0e6c20: TAP::Harness: Move timer initialization

From:
Karl Williamson
Date:
May 23, 2020 20:45
Subject:
[Perl/perl5] 0e6c20: TAP::Harness: Move timer initialization
Message ID:
Perl/perl5/push/refs/heads/smoke-me/khw-bitmap/000000-31b773@github.com
  Branch: refs/heads/smoke-me/khw-bitmap
  Home:   https://github.com/Perl/perl5
  Commit: 0e6c20134aed46d0ce510355200d8fa03ec3d7b1
      https://github.com/Perl/perl5/commit/0e6c20134aed46d0ce510355200d8fa03ec3d7b1
  Author: Karl Williamson <khw@cpan.org>
  Date:   2020-05-23 (Sat, 23 May 2020)

  Changed paths:
    M cpan/Test-Harness/lib/App/Prove.pm
    M cpan/Test-Harness/lib/App/Prove/State.pm
    M cpan/Test-Harness/lib/App/Prove/State/Result.pm
    M cpan/Test-Harness/lib/App/Prove/State/Result/Test.pm
    M cpan/Test-Harness/lib/TAP/Base.pm
    M cpan/Test-Harness/lib/TAP/Formatter/Base.pm
    M cpan/Test-Harness/lib/TAP/Formatter/Color.pm
    M cpan/Test-Harness/lib/TAP/Formatter/Console.pm
    M cpan/Test-Harness/lib/TAP/Formatter/Console/ParallelSession.pm
    M cpan/Test-Harness/lib/TAP/Formatter/Console/Session.pm
    M cpan/Test-Harness/lib/TAP/Formatter/File.pm
    M cpan/Test-Harness/lib/TAP/Formatter/File/Session.pm
    M cpan/Test-Harness/lib/TAP/Formatter/Session.pm
    M cpan/Test-Harness/lib/TAP/Harness.pm
    M cpan/Test-Harness/lib/TAP/Harness/Env.pm
    M cpan/Test-Harness/lib/TAP/Object.pm
    M cpan/Test-Harness/lib/TAP/Parser.pm
    M cpan/Test-Harness/lib/TAP/Parser/Aggregator.pm
    M cpan/Test-Harness/lib/TAP/Parser/Grammar.pm
    M cpan/Test-Harness/lib/TAP/Parser/Iterator.pm
    M cpan/Test-Harness/lib/TAP/Parser/Iterator/Array.pm
    M cpan/Test-Harness/lib/TAP/Parser/Iterator/Process.pm
    M cpan/Test-Harness/lib/TAP/Parser/Iterator/Stream.pm
    M cpan/Test-Harness/lib/TAP/Parser/IteratorFactory.pm
    M cpan/Test-Harness/lib/TAP/Parser/Multiplexer.pm
    M cpan/Test-Harness/lib/TAP/Parser/Result.pm
    M cpan/Test-Harness/lib/TAP/Parser/Result/Bailout.pm
    M cpan/Test-Harness/lib/TAP/Parser/Result/Comment.pm
    M cpan/Test-Harness/lib/TAP/Parser/Result/Plan.pm
    M cpan/Test-Harness/lib/TAP/Parser/Result/Pragma.pm
    M cpan/Test-Harness/lib/TAP/Parser/Result/Test.pm
    M cpan/Test-Harness/lib/TAP/Parser/Result/Unknown.pm
    M cpan/Test-Harness/lib/TAP/Parser/Result/Version.pm
    M cpan/Test-Harness/lib/TAP/Parser/Result/YAML.pm
    M cpan/Test-Harness/lib/TAP/Parser/ResultFactory.pm
    M cpan/Test-Harness/lib/TAP/Parser/Scheduler.pm
    M cpan/Test-Harness/lib/TAP/Parser/Scheduler/Job.pm
    M cpan/Test-Harness/lib/TAP/Parser/Scheduler/Spinner.pm
    M cpan/Test-Harness/lib/TAP/Parser/Source.pm
    M cpan/Test-Harness/lib/TAP/Parser/SourceHandler.pm
    M cpan/Test-Harness/lib/TAP/Parser/SourceHandler/Executable.pm
    M cpan/Test-Harness/lib/TAP/Parser/SourceHandler/File.pm
    M cpan/Test-Harness/lib/TAP/Parser/SourceHandler/Handle.pm
    M cpan/Test-Harness/lib/TAP/Parser/SourceHandler/Perl.pm
    M cpan/Test-Harness/lib/TAP/Parser/SourceHandler/RawTAP.pm
    M cpan/Test-Harness/lib/TAP/Parser/YAMLish/Reader.pm
    M cpan/Test-Harness/lib/TAP/Parser/YAMLish/Writer.pm
    M cpan/Test-Harness/lib/Test/Harness.pm

  Log Message:
  -----------
  TAP::Harness: Move timer initialization

Prior to this commit, the timers for counting elapsed time and CPU usage
were begun when a job's first output appears.  This yields inaccurate
results.  These results are saved in t/test_state for future runs so
that they can start the longest-running tests first, which leads to
using the available cores more efficiently.  (If you start a long running
test after everything else is nearly done, you have to wait for it to
finish before the suite as a whole is; if you start the long ones first,
and the shortest last, you don't have to wait very long for any
stragglers to complete.)  Inaccurate results here lead to this
situation, which we were often seeing in the podcheck.t test.

The worst case is if there is heavy computation at the beginning of the
test being run.  podcheck, for example, examines all the pods in the
directory structure to find which links to other pods do or do not have
corresponding anchors.  Output doesn't happen until the analysis is
complete.  On my system, this takes over 30 seconds, but prior to this
commit, what was noted was just the time required to do the output,
about 200 milliseconds.  The result was that podcheck was viewed as
being one of the shortest tests run, so was started late in the process,
and generally held up the completion of it.

This commit by itself doesn't improve the test completion very much,
because, test tests are run a whole directory at a time, and the
directory podcheck is in, for example, is run last.  The next commit
addresses that.


  Commit: de4aa936e4eeedb7adc4b94b9f19b276ff6f5a90
      https://github.com/Perl/perl5/commit/de4aa936e4eeedb7adc4b94b9f19b276ff6f5a90
  Author: Karl Williamson <khw@cpan.org>
  Date:   2020-05-23 (Sat, 23 May 2020)

  Changed paths:
    M t/harness

  Log Message:
  -----------
  XXX env name: t/harness: Add option for faster test suite execution

This commit adds an environment variable, XXX, which if set to non-zero
increases the parallelism in the execution of the test suite, speeding
it up on systems with multiple cores.

Normally, there are two main test sections, one for core and the second
for non-core tests, and the testing of the non-core one doesn't begin
until the first is complete.  Within each section, there are a number of
test categories, like 're' for regular expressions, and 'JSON::PP' for
the pure perl implementation of JSON.

Within each category, there are various single .t test files.  Some
categories can have those be tested in parallel; some require them to be
done in a particular order, say because an earlier .t does setup for
subsequent ones.  We already have this capability.

Completion of all the tests in a category is not needed before those of
another category can be started.  This is how it already works.

However, the core section categories are ordered so that they begin in a
logical order for someone trying to get perl to work.  First to start
are the basic sanity tests, then by roughly decreasing order of
widespread use in perl programs in the wild, with the final two
categories, porting and perf, being mainly of use to perl5 porters.
These two categories aren't started until all the tests in the earlier
categories are started.  We have some long running tests in those two
categories, and generally they delay the start of the entire second section.

If those long running tests could be started sooner, shorter tests in
the first section could be run in parallel with them, increasing the
average CPU utilization, and the second section could begin (and hence
end) earlier, shortening the total elapsed execution time of the entire
suite.

The second section has some very long running tests.  JSON-PP is one of
them.  If it could run in parallel with tests from the first section,
that would also speed up the completion of the suite.

The environment variable added by this commit does both things.  The
basic sanity test categories in the first section continue to be started
before anything else.  But then all other tests are run in decreasing
order of elapsed time they take to run, removing the boundaries between
some categories, and between the two sections.

The gain from this increases as the number of jobs run in parallel does;
slower high core platforms have the highest increase.  On the old
dromedary with 24 cores, the gain is 20%, almost 2 minutes.  On my more
modern box with 12 cores, it is 8%.


  Commit: 4d746842f64b1a4733117869428c9b41b467c938
      https://github.com/Perl/perl5/commit/4d746842f64b1a4733117869428c9b41b467c938
  Author: Karl Williamson <khw@cpan.org>
  Date:   2020-05-23 (Sat, 23 May 2020)

  Changed paths:
    M embed.fnc
    M embed.h
    M proto.h
    M regcomp.c

  Log Message:
  -----------
  regcomp.c: Extract code from a too-large-function

S_regclass() is unwieldy.  This commit splits it into two nearly equal
size parts.  More could be done.


  Commit: f407d6890fc0d1b9618c8a884218b2c7f85d8a39
      https://github.com/Perl/perl5/commit/f407d6890fc0d1b9618c8a884218b2c7f85d8a39
  Author: Karl Williamson <khw@cpan.org>
  Date:   2020-05-23 (Sat, 23 May 2020)

  Changed paths:
    M regcomp.c

  Log Message:
  -----------
  regcomp.c: Almost all white-space; one paren pair added

The parens are for clarity in an expression.


  Commit: 8fa6af587a1f01c9312b6ece171f10a3c6731f50
      https://github.com/Perl/perl5/commit/8fa6af587a1f01c9312b6ece171f10a3c6731f50
  Author: Karl Williamson <khw@cpan.org>
  Date:   2020-05-23 (Sat, 23 May 2020)

  Changed paths:
    M regcomp.c

  Log Message:
  -----------
  regcomp.c: Consolidate duplicate code


  Commit: f19194b2aefc18d7499e839b5921d6e7cbe5ea17
      https://github.com/Perl/perl5/commit/f19194b2aefc18d7499e839b5921d6e7cbe5ea17
  Author: Karl Williamson <khw@cpan.org>
  Date:   2020-05-23 (Sat, 23 May 2020)

  Changed paths:
    M regexec.c

  Log Message:
  -----------
  regexec.c: Move parameter cast into macro

Instead of calling the macro with a cast parameter, do the cast inside
the macro so the caller doesn't have to be bothered with it.


  Commit: 3a4df6b156ae382585c928c77ff1004def287405
      https://github.com/Perl/perl5/commit/3a4df6b156ae382585c928c77ff1004def287405
  Author: Karl Williamson <khw@cpan.org>
  Date:   2020-05-23 (Sat, 23 May 2020)

  Changed paths:
    M regexec.c

  Log Message:
  -----------
  regexec.c: Refactor macro to generalize it

This is in preparation for a somewhat different use to be added.


  Commit: 204a19608f7dadf411dca90f7bf4d2de54a0f90a
      https://github.com/Perl/perl5/commit/204a19608f7dadf411dca90f7bf4d2de54a0f90a
  Author: Karl Williamson <khw@cpan.org>
  Date:   2020-05-23 (Sat, 23 May 2020)

  Changed paths:
    M regexec.c

  Log Message:
  -----------
  regexec.c: Slight speed up of intuit matching

For an operation where we know there is an initial substring, the code
now looks for that whole substring before returning a candidate
position.  Previously it looked for just the first byte, and then the
condition had to include looking for the remainder.  Effectively
memmem() is called instead of memchr() followed by a comparison.


  Commit: 83330820367a84d707ed715af61aa03b614dbc00
      https://github.com/Perl/perl5/commit/83330820367a84d707ed715af61aa03b614dbc00
  Author: Karl Williamson <khw@cpan.org>
  Date:   2020-05-23 (Sat, 23 May 2020)

  Changed paths:
    M regcomp.c

  Log Message:
  -----------
  regcomp.c: Move some code to within a block

This code is irrelevant unless the condition of the block immediately
before it is TRUE, so move it to within that block.


  Commit: 984de8accbc4a0d28cb247a62abce96877fd1162
      https://github.com/Perl/perl5/commit/984de8accbc4a0d28cb247a62abce96877fd1162
  Author: Karl Williamson <khw@cpan.org>
  Date:   2020-05-23 (Sat, 23 May 2020)

  Changed paths:
    M regcomp.c

  Log Message:
  -----------
  regcomp.c: White-space only

Indent code now in a new block


  Commit: 3b84fa0944a8229b054a05b507e58949fa649c52
      https://github.com/Perl/perl5/commit/3b84fa0944a8229b054a05b507e58949fa649c52
  Author: Karl Williamson <khw@cpan.org>
  Date:   2020-05-23 (Sat, 23 May 2020)

  Changed paths:
    M regcomp.c

  Log Message:
  -----------
  regcomp.c: Add a clearer mnemonic


  Commit: 3d7543b5c3405785555f3186f9d5d3faf8f85d6d
      https://github.com/Perl/perl5/commit/3d7543b5c3405785555f3186f9d5d3faf8f85d6d
  Author: Karl Williamson <khw@cpan.org>
  Date:   2020-05-23 (Sat, 23 May 2020)

  Changed paths:
    M regcomp.c

  Log Message:
  -----------
  regcomp.c: Save a value instead of re-calling fcn

This variable will be used in future commits in more places, so compute
it just once.


  Commit: ec969aeeafa540942f8a68599612291c34a783d0
      https://github.com/Perl/perl5/commit/ec969aeeafa540942f8a68599612291c34a783d0
  Author: Karl Williamson <khw@cpan.org>
  Date:   2020-05-23 (Sat, 23 May 2020)

  Changed paths:
    M pod/perldebguts.pod
    M regcomp.sym
    M regnodes.h

  Log Message:
  -----------
  XXX flesh out: regcomp.sym: Add POSIXA1R node


  Commit: 650ec9177a3893e7078916dcca0cff9dcc193099
      https://github.com/Perl/perl5/commit/650ec9177a3893e7078916dcca0cff9dcc193099
  Author: Karl Williamson <khw@cpan.org>
  Date:   2020-05-23 (Sat, 23 May 2020)

  Changed paths:
    M regcomp.c
    M regcomp.h
    M regexec.c

  Log Message:
  -----------
  Use POSIXA1R


  Commit: 31b7730c1ab3c531f34b99dc0cb08d70b86b2a24
      https://github.com/Perl/perl5/commit/31b7730c1ab3c531f34b99dc0cb08d70b86b2a24
  Author: Karl Williamson <khw@cpan.org>
  Date:   2020-05-23 (Sat, 23 May 2020)

  Changed paths:
    M Porting/bench.pl

  Log Message:
  -----------
  XXX don't push, khw customization for bench.pl


Compare: https://github.com/Perl/perl5/compare/0e6c20134aed%5E...31b7730c1ab3



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About