This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[MERGE] eliminate PL_reginput
authorDavid Mitchell <davem@iabyn.com>
Fri, 14 Sep 2012 07:53:26 +0000 (08:53 +0100)
committerDavid Mitchell <davem@iabyn.com>
Fri, 14 Sep 2012 07:53:26 +0000 (08:53 +0100)
The variable PL_reginput (which is actually part of the
global/per-interpreter variable PL_reg_state), is mainly used just
locally within the S_regmatch() function. In this role, it effectively
competes with the local-to-regmatch() variable locinput, as a pointer
that tracks the current match position.

Having two variables that do this is less efficient,and makes the code
harder to understand. So this series of commits:

1) removes PL_reginput, and replaces it with a var, reginput, local to
   regmatch();
2) successively removes more and uses of the reginput variable, until
3) it is eliminated altogether, leaving locinput as the sole 'here we are'
   pointer.

Looking at the CPU usage of running the t/re/*.t tests on a -O2,
non-threaded build, running each test suite 3 times, gives:

before: 55.35 55.66 55.69
after:  55.10 55.13 55.33

which indicates a small performance improvement of around 0.5%.

(The CPU usage of a single run of the whole perl test suite dropped from
783.31s to 777.23s).


No differences found