In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/68b940afc96546256736bc5d8185075ddc12b205?hp=31f8924d9e997070af9ca909e3a78848c4d1972b>
- Log ----------------------------------------------------------------- commit 68b940afc96546256736bc5d8185075ddc12b205 Author: David Mitchell <[email protected]> Date: Sat Apr 9 16:43:20 2016 +0100 move perf test from re/pat.t to re/speed.t These days we generally put re tests which rely on timing in a separate file, t/re/speed.t; move a recently-added test there. ----------------------------------------------------------------------- Summary of changes: t/re/pat.t | 13 +------------ t/re/speed.t | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/t/re/pat.t b/t/re/pat.t index 73eadd9..295a9f7 100644 --- a/t/re/pat.t +++ b/t/re/pat.t @@ -23,7 +23,7 @@ BEGIN { skip_all_without_unicode_tables(); } -plan tests => 790; # Update this when adding/deleting tests. +plan tests => 789; # Update this when adding/deleting tests. run_tests() unless caller; @@ -1758,17 +1758,6 @@ EOP fresh_perl_is($code, $expect, {}, "$bug - $test_name" ); } } - { - # [perl #127855] Slowdown in m//g on COW strings of certain lengths - my $elapsed= -time; - my $len= 4e6; - my $zeros= 40000; - my $str= ( "0" x $zeros ) . ( "1" x ( $len - $zeros ) ); - my $substr= substr( $str, 1 ); - 1 while $substr=~m/0/g; - $elapsed += time; - ok( $elapsed <= 1, "should not COW on long string with substr and m//g"); - } } # End of sub run_tests 1; diff --git a/t/re/speed.t b/t/re/speed.t index 28d4dbb..648f2e9 100644 --- a/t/re/speed.t +++ b/t/re/speed.t @@ -23,7 +23,7 @@ BEGIN { skip_all_without_unicode_tables(); } -plan tests => 57; #** update watchdog timeouts proportionally when adding tests +plan tests => 58; #** update watchdog timeouts proportionally when adding tests use strict; use warnings; @@ -140,6 +140,20 @@ PROG } } + { + # [perl #127855] Slowdown in m//g on COW strings of certain lengths + # this should take milliseconds, but took 10's of seconds. + my $elapsed= -time; + my $len= 4e6; + my $zeros= 40000; + my $str= ( "0" x $zeros ) . ( "1" x ( $len - $zeros ) ); + my $substr= substr( $str, 1 ); + 1 while $substr=~m/0/g; + $elapsed += time; + ok( $elapsed <= 1, "should not COW on long string with substr and m//g"); + } + + } # End of sub run_tests 1; -- Perl5 Master Repository
