3 # This file specifies an array-of-hashes that define snippets of code that
4 # can be run by various measurement and profiling tools.
6 # The basic idea is that any time you add an optimisation that is intended
7 # to make a particular construct faster, then you should add that construct
10 # Under the normal test suite, the test file benchmarks.t does a basic
11 # compile and run of each of these snippets; not to test performance,
12 # but just to ensure that the code doesn't have errors.
14 # Over time, it is intended that various measurement and profiling tools
15 # will be written that can run selected (or all) snippets in various
16 # environments. These will not be run as part of a normal test suite run.
18 # It is intended that the tests in this file will be lightweight; e.g.
19 # a hash access, an empty function call, or a single regex match etc.
21 # This file is designed to be read in by 'do' (and in such a way that
22 # multiple versions of this file from different releases can be read in
23 # by a single process).
25 # The top-level array has name/hash pairs (we use an array rather than a
26 # hash so that duplicate keys can be spotted) Each name is a token that
27 # describes a particular test. Code will be compiled in the package named
28 # after the token, so it should match /^(\w|::)+$/a. It is intended that
29 # this can be used on the command line of tools to select particular
31 # In addition, the package names are arranged into an informal hierarchy
32 # whose top members are (this is subject to change):
34 # call:: subroutine and method handling
35 # expr:: expressions: e.g. $x=1, $foo{bar}[0]
36 # func:: perl functions, e.g. func::sort::...
37 # loop:: structural code like for, while(), etc
38 # regex:: regular expressions
39 # string:: string handling
42 # Each hash has three fields:
44 # desc is a description of the test
45 # setup is a string containing setup code
46 # code is a string containing the code to run in a loop
48 # So typically a benchmark tool might do something like
50 # eval "package $token; $setup; for (1..1000000) { $code }"
52 # Currently the only tool that uses this file is Porting/bench.pl;
53 # try C<perl Porting/bench.pl --help> for more info
57 # Note: for the cachegrind variant, an entry like
62 # creates two temporary perl sources looking like:
67 # for my $__loop__ (1..$ARGV[0]) {
71 # and as above, but with the '1;' in the loop body replaced with:
75 # It then pipes each of the two sources into
77 # PERL_HASH_SEED=0 valgrind [options] someperl [options] - N
79 # where N is set to 10 and then 20.
81 # It then uses the result of those four cachegrind runs to subtract out
82 # the perl startup and loop overheads. So only what's in SETUP and CODE
83 # can affect the benchmark, and if the loop happens to leave some state
84 # changed (such as storing a value in a hash), then the final benchmark
85 # timing is the result of running CODE with the hash entry populated
90 'call::sub::empty' => {
91 desc => 'function call with no args or body',
95 'call::sub::amp_empty' => {
96 desc => '&foo function call with no args or body',
97 setup => 'sub f { }; @_ = ();',
100 'call::sub::args3' => {
101 desc => 'function call with 3 local lexical vars',
102 setup => 'sub f { my ($a, $b, $c) = @_; 1 }',
105 'call::sub::args2_ret1' => {
106 desc => 'function call with 2 local lex vars and 1 return value',
107 setup => 'my $x; sub f { my ($a, $b) = @_; $a+$b }',
108 code => '$x = f(1,2)',
110 'call::sub::args2_ret1temp' => {
111 desc => 'function call with 2 local lex vars and 1 return TEMP value',
112 setup => 'my $x; sub f { my ($a, $b) = @_; \$a }',
113 code => '$x = f(1,2)',
115 'call::sub::args3_ret3' => {
116 desc => 'function call with 3 local lex vars and 3 return values',
117 setup => 'my @a; sub f { my ($a, $b, $c) = @_; $a+$b, $c, 1 }',
118 code => '@a = f(1,2,3)',
120 'call::sub::args3_ret3str' => {
121 desc => 'function call with 3 local lex vars and 3 string return values',
122 setup => 'my @a; sub f { my ($a, $b, $c) = @_; my @s = ("aa","bb","cc"); @s }',
123 code => '@a = f(1,2,3)',
125 'call::sub::args3_ret3temp' => {
126 desc => 'function call with 3 local lex vars and 3 TEMP return values',
127 setup => 'my @a; sub f { my ($a, $b, $c) = @_; 1..3 }',
128 code => '@a = f(1,2,3)',
130 'call::sub::recursive' => {
131 desc => 'basic recursive function call',
132 setup => 'my $x; sub f { my ($i) = @_; $i > 0 ? $i + f($i-1) : 0 }',
136 'call::goto::empty' => {
137 desc => 'goto &funtion with no args or body',
138 setup => 'sub f { goto &g } sub g {}',
141 'call::goto::args3' => {
142 desc => 'goto &funtion with 3 local lexical vars',
143 setup => 'sub f { goto &g } sub g { my ($a, $b, $c) = @_ }',
148 'expr::array::lex_1const_0' => {
149 desc => 'lexical $array[0]',
150 setup => 'my @a = (1)',
153 'expr::array::lex_1const_m1' => {
154 desc => 'lexical $array[-1]',
155 setup => 'my @a = (1)',
158 'expr::array::lex_2const' => {
159 desc => 'lexical $array[const][const]',
160 setup => 'my @a = ([1,2])',
163 'expr::array::lex_2var' => {
164 desc => 'lexical $array[$i1][$i2]',
165 setup => 'my ($i1,$i2) = (0,1); my @a = ([1,2])',
166 code => '$a[$i1][$i2]',
168 'expr::array::ref_lex_2var' => {
169 desc => 'lexical $arrayref->[$i1][$i2]',
170 setup => 'my ($i1,$i2) = (0,1); my $r = [[1,2]]',
171 code => '$r->[$i1][$i2]',
173 'expr::array::ref_lex_3const' => {
174 desc => 'lexical $arrayref->[const][const][const]',
175 setup => 'my $r = [[[1,2]]]',
176 code => '$r->[0][0][0]',
178 'expr::array::ref_expr_lex_3const' => {
179 desc => '(lexical expr)->[const][const][const]',
180 setup => 'my $r = [[[1,2]]]',
181 code => '($r||0)->[0][0][0]',
185 'expr::array::pkg_1const_0' => {
186 desc => 'package $array[0]',
190 'expr::array::pkg_1const_m1' => {
191 desc => 'package $array[-1]',
195 'expr::array::pkg_2const' => {
196 desc => 'package $array[const][const]',
197 setup => '@a = ([1,2])',
200 'expr::array::pkg_2var' => {
201 desc => 'package $array[$i1][$i2]',
202 setup => '($i1,$i2) = (0,1); @a = ([1,2])',
203 code => '$a[$i1][$i2]',
205 'expr::array::ref_pkg_2var' => {
206 desc => 'package $arrayref->[$i1][$i2]',
207 setup => '($i1,$i2) = (0,1); $r = [[1,2]]',
208 code => '$r->[$i1][$i2]',
210 'expr::array::ref_pkg_3const' => {
211 desc => 'package $arrayref->[const][const][const]',
212 setup => '$r = [[[1,2]]]',
213 code => '$r->[0][0][0]',
215 'expr::array::ref_expr_pkg_3const' => {
216 desc => '(package expr)->[const][const][const]',
217 setup => '$r = [[[1,2]]]',
218 code => '($r||0)->[0][0][0]',
222 'expr::arrayhash::lex_3var' => {
223 desc => 'lexical $h{$k1}[$i]{$k2}',
224 setup => 'my ($i, $k1, $k2) = (0,"foo","bar");'
225 . 'my %h = (foo => [ { bar => 1 } ])',
226 code => '$h{$k1}[$i]{$k2}',
228 'expr::arrayhash::pkg_3var' => {
229 desc => 'package $h{$k1}[$i]{$k2}',
230 setup => '($i, $k1, $k2) = (0,"foo","bar");'
231 . '%h = (foo => [ { bar => 1 } ])',
232 code => '$h{$k1}[$i]{$k2}',
235 'expr::hash::lex_1const' => {
236 desc => 'lexical $hash{const}',
237 setup => 'my %h = ("foo" => 1)',
240 'expr::hash::lex_2const' => {
241 desc => 'lexical $hash{const}{const}',
242 setup => 'my %h = (foo => { bar => 1 })',
243 code => '$h{foo}{bar}',
245 'expr::hash::lex_2var' => {
246 desc => 'lexical $hash{$k1}{$k2}',
247 setup => 'my ($k1,$k2) = qw(foo bar); my %h = ($k1 => { $k2 => 1 })',
248 code => '$h{$k1}{$k2}',
250 'expr::hash::ref_lex_2var' => {
251 desc => 'lexical $hashref->{$k1}{$k2}',
252 setup => 'my ($k1,$k2) = qw(foo bar); my $r = {$k1 => { $k2 => 1 }}',
253 code => '$r->{$k1}{$k2}',
255 'expr::hash::ref_lex_3const' => {
256 desc => 'lexical $hashref->{const}{const}{const}',
257 setup => 'my $r = {foo => { bar => { baz => 1 }}}',
258 code => '$r->{foo}{bar}{baz}',
260 'expr::hash::ref_expr_lex_3const' => {
261 desc => '(lexical expr)->{const}{const}{const}',
262 setup => 'my $r = {foo => { bar => { baz => 1 }}}',
263 code => '($r||0)->{foo}{bar}{baz}',
266 'expr::hash::pkg_1const' => {
267 desc => 'package $hash{const}',
268 setup => '%h = ("foo" => 1)',
271 'expr::hash::pkg_2const' => {
272 desc => 'package $hash{const}{const}',
273 setup => '%h = (foo => { bar => 1 })',
274 code => '$h{foo}{bar}',
276 'expr::hash::pkg_2var' => {
277 desc => 'package $hash{$k1}{$k2}',
278 setup => '($k1,$k2) = qw(foo bar); %h = ($k1 => { $k2 => 1 })',
279 code => '$h{$k1}{$k2}',
281 'expr::hash::ref_pkg_2var' => {
282 desc => 'package $hashref->{$k1}{$k2}',
283 setup => '($k1,$k2) = qw(foo bar); $r = {$k1 => { $k2 => 1 }}',
284 code => '$r->{$k1}{$k2}',
286 'expr::hash::ref_pkg_3const' => {
287 desc => 'package $hashref->{const}{const}{const}',
288 setup => '$r = {foo => { bar => { baz => 1 }}}',
289 code => '$r->{foo}{bar}{baz}',
291 'expr::hash::ref_expr_pkg_3const' => {
292 desc => '(package expr)->{const}{const}{const}',
293 setup => '$r = {foo => { bar => { baz => 1 }}}',
294 code => '($r||0)->{foo}{bar}{baz}',
298 'expr::hash::exists_lex_2var' => {
299 desc => 'lexical exists $hash{$k1}{$k2}',
300 setup => 'my ($k1,$k2) = qw(foo bar); my %h = ($k1 => { $k2 => 1 });',
301 code => 'exists $h{$k1}{$k2}',
304 'expr::hash::bool_empty' => {
305 desc => 'empty lexical hash in boolean context',
309 'expr::hash::bool_full' => {
310 desc => 'non-empty lexical hash in boolean context',
311 setup => 'my %h = 1..10;',
318 sprintf('expr::hash::notexists_lex_keylen%04d',$_) => {
319 desc => 'exists on non-key of length '. $_,
320 setup => 'my %h; my $key = "A" x ' . $_ . '; $h{$key."x"} = 1;',
321 code => 'exists $h{$key}',
325 # 1,2,3,7,8,9,14,15,16,20,24,
333 sprintf('expr::hash::exists_lex_keylen%04d',$_) => {
334 desc => 'exists on existing key of length '. $_,
335 setup => 'my %h; my $key = "A" x ' . $_ . '; $h{$key} = 1;',
336 code => 'exists $h{$key}',
340 # 1,2,3,7,8,9,14,15,16,20,24,
347 'expr::hash::delete_lex_2var' => {
348 desc => 'lexical delete $hash{$k1}{$k2}',
349 setup => 'my ($k1,$k2) = qw(foo bar); my %h = ($k1 => { $k2 => 1 });',
350 code => 'delete $h{$k1}{$k2}',
354 # list assign, OP_AASSIGN
359 'expr::aassign::ma_empty' => {
360 desc => 'my array assigned empty',
362 code => 'my @a = ()',
364 'expr::aassign::lax_empty' => {
365 desc => 'non-empty lexical array assigned empty',
366 setup => 'my @a = 1..3;',
369 'expr::aassign::llax_empty' => {
370 desc => 'non-empty lexical var and array assigned empty',
371 setup => 'my ($x, @a) = 1..4;',
372 code => '($x, @a) = ()',
374 'expr::aassign::mh_empty' => {
375 desc => 'my hash assigned empty',
377 code => 'my %h = ()',
379 'expr::aassign::lhx_empty' => {
380 desc => 'non-empty lexical hash assigned empty',
381 setup => 'my %h = 1..4;',
384 'expr::aassign::llhx_empty' => {
385 desc => 'non-empty lexical var and hash assigned empty',
386 setup => 'my ($x, %h) = 1..5;',
387 code => '($x, %h) = ()',
389 'expr::aassign::3m_empty' => {
390 desc => 'three my vars assigned empty',
392 code => 'my ($x,$y,$z) = ()',
394 'expr::aassign::3l_empty' => {
395 desc => 'three lexical vars assigned empty',
396 setup => 'my ($x,$y,$z)',
397 code => '($x,$y,$z) = ()',
399 'expr::aassign::3lref_empty' => {
400 desc => 'three lexical ref vars assigned empty',
401 setup => 'my ($x,$y,$z); my $r = []; ',
402 code => '($x,$y,$z) = ($r,$r,$r); ($x,$y,$z) = ()',
404 'expr::aassign::pa_empty' => {
405 desc => 'package array assigned empty',
409 'expr::aassign::pax_empty' => {
410 desc => 'non-empty package array assigned empty',
411 setup => '@a = (1,2,3)',
414 'expr::aassign::3p_empty' => {
415 desc => 'three package vars assigned empty',
416 setup => '($x,$y,$z) = 1..3;',
417 code => '($x,$y,$z) = ()',
422 'expr::aassign::ma_3c' => {
423 desc => 'my array assigned 3 consts',
425 code => 'my @a = (1,2,3)',
427 'expr::aassign::lax_3c' => {
428 desc => 'non-empty lexical array assigned 3 consts',
429 setup => 'my @a = 1..3;',
430 code => '@a = (1,2,3)',
432 'expr::aassign::llax_3c' => {
433 desc => 'non-empty lexical var and array assigned 3 consts',
434 setup => 'my ($x, @a) = 1..4;',
435 code => '($x, @a) = (1,2,3)',
437 'expr::aassign::mh_4c' => {
438 desc => 'my hash assigned 4 consts',
440 code => 'my %h = qw(a 1 b 2)',
442 'expr::aassign::lhx_4c' => {
443 desc => 'non-empty lexical hash assigned 4 consts',
444 setup => 'my %h = qw(a 1 b 2);',
445 code => '%h = qw(c 3 d 4)',
447 'expr::aassign::llhx_5c' => {
448 desc => 'non-empty lexical var and array assigned 5 consts',
449 setup => 'my ($x, %h) = (1, qw(a 1 b 2));',
450 code => '($x, %h) = (10, qw(c 3 d 4))',
452 'expr::aassign::3m_3c' => {
453 desc => 'three my vars assigned 3 consts',
455 code => 'my ($x,$y,$z) = (1,2,3)',
457 'expr::aassign::3l_3c' => {
458 desc => 'three lexical vars assigned 3 consts',
459 setup => 'my ($x,$y,$z)',
460 code => '($x,$y,$z) = (1,2,3)',
462 'expr::aassign::pa_3c' => {
463 desc => 'package array assigned 3 consts',
465 code => '@a = (1,2,3)',
467 'expr::aassign::pax_3c' => {
468 desc => 'non-empty package array assigned 3 consts',
469 setup => '@a = (1,2,3)',
470 code => '@a = (1,2,3)',
472 'expr::aassign::3p_3c' => {
473 desc => 'three package vars assigned 3 consts',
474 setup => '($x,$y,$z) = 1..3;',
475 code => '($x,$y,$z) = (1,2,3)',
480 'expr::aassign::ma_la' => {
481 desc => 'my array assigned lexical array',
482 setup => 'my @init = 1..3;',
483 code => 'my @a = @init',
485 'expr::aassign::lax_la' => {
486 desc => 'non-empty lexical array assigned lexical array',
487 setup => 'my @init = 1..3; my @a = 1..3;',
488 code => '@a = @init',
490 'expr::aassign::llax_la' => {
491 desc => 'non-empty lexical var and array assigned lexical array',
492 setup => 'my @init = 1..3; my ($x, @a) = 1..4;',
493 code => '($x, @a) = @init',
495 'expr::aassign::3m_la' => {
496 desc => 'three my vars assigned lexical array',
497 setup => 'my @init = 1..3;',
498 code => 'my ($x,$y,$z) = @init',
500 'expr::aassign::3l_la' => {
501 desc => 'three lexical vars assigned lexical array',
502 setup => 'my @init = 1..3; my ($x,$y,$z)',
503 code => '($x,$y,$z) = @init',
505 'expr::aassign::pa_la' => {
506 desc => 'package array assigned lexical array',
507 setup => 'my @init = 1..3;',
508 code => '@a = @init',
510 'expr::aassign::pax_la' => {
511 desc => 'non-empty package array assigned lexical array',
512 setup => 'my @init = 1..3; @a = @init',
513 code => '@a = @init',
515 'expr::aassign::3p_la' => {
516 desc => 'three package vars assigned lexical array',
517 setup => 'my @init = 1..3; ($x,$y,$z) = 1..3;',
518 code => '($x,$y,$z) = @init',
523 'expr::aassign::ma_pa' => {
524 desc => 'my array assigned package array',
525 setup => '@init = 1..3;',
526 code => 'my @a = @init',
528 'expr::aassign::lax_pa' => {
529 desc => 'non-empty lexical array assigned package array',
530 setup => '@init = 1..3; my @a = 1..3;',
531 code => '@a = @init',
533 'expr::aassign::llax_pa' => {
534 desc => 'non-empty lexical var and array assigned package array',
535 setup => '@init = 1..3; my ($x, @a) = 1..4;',
536 code => '($x, @a) = @init',
538 'expr::aassign::3m_pa' => {
539 desc => 'three my vars assigned package array',
540 setup => '@init = 1..3;',
541 code => 'my ($x,$y,$z) = @init',
543 'expr::aassign::3l_pa' => {
544 desc => 'three lexical vars assigned package array',
545 setup => '@init = 1..3; my ($x,$y,$z)',
546 code => '($x,$y,$z) = @init',
548 'expr::aassign::pa_pa' => {
549 desc => 'package array assigned package array',
550 setup => '@init = 1..3;',
551 code => '@a = @init',
553 'expr::aassign::pax_pa' => {
554 desc => 'non-empty package array assigned package array',
555 setup => '@init = 1..3; @a = @init',
556 code => '@a = @init',
558 'expr::aassign::3p_pa' => {
559 desc => 'three package vars assigned package array',
560 setup => '@init = 1..3; ($x,$y,$z) = 1..3;',
561 code => '($x,$y,$z) = @init',
566 'expr::aassign::ma_defary' => {
567 desc => 'my array assigned @_',
568 setup => '@_ = 1..3;',
569 code => 'my @a = @_',
571 'expr::aassign::lax_defary' => {
572 desc => 'non-empty lexical array assigned @_',
573 setup => '@_ = 1..3; my @a = 1..3;',
576 'expr::aassign::llax_defary' => {
577 desc => 'non-empty lexical var and array assigned @_',
578 setup => '@_ = 1..3; my ($x, @a) = 1..4;',
579 code => '($x, @a) = @_',
581 'expr::aassign::3m_defary' => {
582 desc => 'three my vars assigned @_',
583 setup => '@_ = 1..3;',
584 code => 'my ($x,$y,$z) = @_',
586 'expr::aassign::3l_defary' => {
587 desc => 'three lexical vars assigned @_',
588 setup => '@_ = 1..3; my ($x,$y,$z)',
589 code => '($x,$y,$z) = @_',
591 'expr::aassign::pa_defary' => {
592 desc => 'package array assigned @_',
593 setup => '@_ = 1..3;',
596 'expr::aassign::pax_defary' => {
597 desc => 'non-empty package array assigned @_',
598 setup => '@_ = 1..3; @a = @_',
601 'expr::aassign::3p_defary' => {
602 desc => 'three package vars assigned @_',
603 setup => '@_ = 1..3; ($x,$y,$z) = 1..3;',
604 code => '($x,$y,$z) = @_',
608 # (....) = ($lex1,$lex2,$lex3);
610 'expr::aassign::ma_3l' => {
611 desc => 'my array assigned lexicals',
612 setup => 'my ($v1,$v2,$v3) = 1..3;',
613 code => 'my @a = ($v1,$v2,$v3)',
615 'expr::aassign::lax_3l' => {
616 desc => 'non-empty lexical array assigned lexicals',
617 setup => 'my ($v1,$v2,$v3) = 1..3; my @a = 1..3;',
618 code => '@a = ($v1,$v2,$v3)',
620 'expr::aassign::llax_3l' => {
621 desc => 'non-empty lexical var and array assigned lexicals',
622 setup => 'my ($v1,$v2,$v3) = 1..3; my ($x, @a) = 1..4;',
623 code => '($x, @a) = ($v1,$v2,$v3)',
625 'expr::aassign::3m_3l' => {
626 desc => 'three my vars assigned lexicals',
627 setup => 'my ($v1,$v2,$v3) = 1..3;',
628 code => 'my ($x,$y,$z) = ($v1,$v2,$v3)',
630 'expr::aassign::3l_3l' => {
631 desc => 'three lexical vars assigned lexicals',
632 setup => 'my ($v1,$v2,$v3) = 1..3; my ($x,$y,$z)',
633 code => '($x,$y,$z) = ($v1,$v2,$v3)',
635 'expr::aassign::pa_3l' => {
636 desc => 'package array assigned lexicals',
637 setup => 'my ($v1,$v2,$v3) = 1..3;',
638 code => '@a = ($v1,$v2,$v3)',
640 'expr::aassign::pax_3l' => {
641 desc => 'non-empty package array assigned lexicals',
642 setup => 'my ($v1,$v2,$v3) = 1..3; @a = @_',
643 code => '@a = ($v1,$v2,$v3)',
645 'expr::aassign::3p_3l' => {
646 desc => 'three package vars assigned lexicals',
647 setup => 'my ($v1,$v2,$v3) = 1..3; ($x,$y,$z) = 1..3;',
648 code => '($x,$y,$z) = ($v1,$v2,$v3)',
652 # (....) = ($pkg1,$pkg2,$pkg3);
654 'expr::aassign::ma_3p' => {
655 desc => 'my array assigned 3 package vars',
656 setup => '($v1,$v2,$v3) = 1..3;',
657 code => 'my @a = ($v1,$v2,$v3)',
659 'expr::aassign::lax_3p' => {
660 desc => 'non-empty lexical array assigned 3 package vars',
661 setup => '($v1,$v2,$v3) = 1..3; my @a = 1..3;',
662 code => '@a = ($v1,$v2,$v3)',
664 'expr::aassign::llax_3p' => {
665 desc => 'non-empty lexical var and array assigned 3 package vars',
666 setup => '($v1,$v2,$v3) = 1..3; my ($x, @a) = 1..4;',
667 code => '($x, @a) = ($v1,$v2,$v3)',
669 'expr::aassign::3m_3p' => {
670 desc => 'three my vars assigned 3 package vars',
671 setup => '($v1,$v2,$v3) = 1..3;',
672 code => 'my ($x,$y,$z) = ($v1,$v2,$v3)',
674 'expr::aassign::3l_3p' => {
675 desc => 'three lexical vars assigned 3 package vars',
676 setup => '($v1,$v2,$v3) = 1..3; my ($x,$y,$z)',
677 code => '($x,$y,$z) = ($v1,$v2,$v3)',
679 'expr::aassign::pa_3p' => {
680 desc => 'package array assigned 3 package vars',
681 setup => '($v1,$v2,$v3) = 1..3;',
682 code => '@a = ($v1,$v2,$v3)',
684 'expr::aassign::pax_3p' => {
685 desc => 'non-empty package array assigned 3 package vars',
686 setup => '($v1,$v2,$v3) = 1..3; @a = @_',
687 code => '@a = ($v1,$v2,$v3)',
689 'expr::aassign::3p_3p' => {
690 desc => 'three package vars assigned 3 package vars',
691 setup => '($v1,$v2,$v3) = 1..3; ($x,$y,$z) = 1..3;',
692 code => '($x,$y,$z) = ($v1,$v2,$v3)',
696 # (....) = (1,2,$shared);
698 'expr::aassign::llax_2c1s' => {
699 desc => 'non-empty lexical var and array assigned 2 consts and 1 shared var',
700 setup => 'my ($x, @a) = 1..4;',
701 code => '($x, @a) = (1,2,$x)',
703 'expr::aassign::3l_2c1s' => {
704 desc => 'three lexical vars assigned 2 consts and 1 shared var',
705 setup => 'my ($x,$y,$z) = 1..3;',
706 code => '($x,$y,$z) = (1,2,$x)',
708 'expr::aassign::3p_2c1s' => {
709 desc => 'three package vars assigned 2 consts and 1 shared var',
710 setup => '($x,$y,$z) = 1..3;',
711 code => '($x,$y,$z) = (1,2,$x)',
717 'expr::aassign::2l_swap' => {
718 desc => 'swap two lexical vars',
719 setup => 'my ($a,$b) = (1,2)',
720 code => '($a,$b) = ($b,$a)',
722 'expr::aassign::2p_swap' => {
723 desc => 'swap two package vars',
724 setup => '($a,$b) = (1,2)',
725 code => '($a,$b) = ($b,$a)',
727 'expr::aassign::2laelem_swap' => {
728 desc => 'swap two lexical vars',
729 setup => 'my @a = (1,2)',
730 code => '($a[0],$a[1]) = ($a[1],$a[0])',
735 'expr::aassign::5l_4l1s' => {
736 desc => 'long list of lexical vars, 1 shared',
737 setup => 'my ($a,$b,$c,$d,$e) = 1..5',
738 code => '($a,$b,$c,$d,$e) = ($a,$a,$c,$d,$e)',
741 'expr::aassign::5p_4p1s' => {
742 desc => 'long list of package vars, 1 shared',
743 setup => '($a,$b,$c,$d,$e) = 1..5',
744 code => '($a,$b,$c,$d,$e) = ($a,$a,$c,$d,$e)',
746 'expr::aassign::5l_defary' => {
747 desc => 'long list of lexical vars to assign @_ to',
748 setup => '@_ = 1..5',
749 code => 'my ($a,$b,$c,$d,$e) = @_',
751 'expr::aassign::5l1la_defary' => {
752 desc => 'long list of lexical vars plus long slurp to assign @_ to',
753 setup => '@_ = 1..20',
754 code => 'my ($a,$b,$c,$d,$e,@rest) = @_',
756 'expr::aassign::1l_2l' => {
757 desc => 'single lexical LHS',
758 setup => 'my $x = 1;',
759 code => '(undef,$x) = ($x,$x)',
761 'expr::aassign::2l_1l' => {
762 desc => 'single lexical RHS',
763 setup => 'my $x = 1;',
764 code => '($x,$x) = ($x)',
766 'expr::aassign::2l_1ul' => {
767 desc => 'undef and single lexical RHS',
768 setup => 'my $x = 1;',
769 code => '($x,$x) = (undef, $x)',
772 'expr::aassign::2list_lex' => {
773 desc => 'lexical ($x, $y) = (1, 2)',
774 setup => 'my ($x, $y)',
775 code => '($x, $y) = (1, 2)',
778 'expr::aassign::lex_rv' => {
779 desc => 'lexical ($ref1, $ref2) = ($ref3, $ref4)',
780 setup => 'my ($r1, $r2, $r3, $r4);
781 ($r1, $r2) = (($r3, $r4) = ([], []));',
782 code => '($r1, $r2) = ($r3, $r4)',
785 'expr::aassign::lex_rv1' => {
786 desc => 'lexical ($ref1, $ref2) = ($ref3, $ref4) where ref1,2 are freed',
787 setup => 'my ($r1, $r2);',
788 code => '($r1, $r2) = ([], []);',
791 # array assign of strings
793 'expr::aassign::la_3s' => {
794 desc => 'assign 3 strings to empty lexical array',
796 code => '@a = (); @a = qw(abc defg hijkl);',
798 'expr::aassign::la_3ts' => {
799 desc => 'assign 3 temp strings to empty lexical array',
801 code => '@a = (); @a = map $_, qw(abc defg hijkl);',
803 'expr::aassign::lan_3s' => {
804 desc => 'assign 3 strings to non-empty lexical array',
805 setup => 'my @a = qw(abc defg hijkl)',
806 code => '@a = qw(abc defg hijkl);',
808 'expr::aassign::lan_3ts' => {
809 desc => 'assign 3 temp strings to non-empty lexical array',
810 setup => 'my @a = qw(abc defg hijkl)',
811 code => '@a = map $_, qw(abc defg hijkl);',
814 # hash assign of strings
816 'expr::aassign::lh_2s' => {
817 desc => 'assign 2 strings to empty lexical hash',
819 code => '%h = (); %h = qw(k1 abc k2 defg);',
821 'expr::aassign::lh_2ts' => {
822 desc => 'assign 2 temp strings to empty lexical hash',
824 code => '%h = (); %h = map $_, qw(k1 abc k2 defg);',
826 'expr::aassign::lhn_2s' => {
827 desc => 'assign 2 strings to non-empty lexical hash',
828 setup => 'my %h = qw(k1 abc k2 defg);',
829 code => '%h = qw(k1 abc k2 defg);',
831 'expr::aassign::lhn_2ts' => {
832 desc => 'assign 2 temp strings to non-empty lexical hash',
833 setup => 'my %h = qw(k1 abc k2 defg);',
834 code => '%h = map $_, qw(k1 abc k2 defg);',
838 'expr::arith::add_lex_ii' => {
839 desc => 'add two integers and assign to a lexical var',
840 setup => 'my ($x,$y,$z) = 1..3;',
841 code => '$z = $x + $y',
843 'expr::arith::add_pkg_ii' => {
844 desc => 'add two integers and assign to a package var',
845 setup => 'my ($x,$y) = 1..2; $z = 3;',
846 code => '$z = $x + $y',
848 'expr::arith::add_lex_nn' => {
849 desc => 'add two NVs and assign to a lexical var',
850 setup => 'my ($x,$y,$z) = (1.1, 2.2, 3.3);',
851 code => '$z = $x + $y',
853 'expr::arith::add_pkg_nn' => {
854 desc => 'add two NVs and assign to a package var',
855 setup => 'my ($x,$y); ($x,$y,$z) = (1.1, 2.2, 3.3);',
856 code => '$z = $x + $y',
858 'expr::arith::add_lex_ni' => {
859 desc => 'add an int and an NV and assign to a lexical var',
860 setup => 'my ($x,$y,$z) = (1, 2.2, 3.3);',
861 code => '$z = $x + $y',
863 'expr::arith::add_pkg_ni' => {
864 desc => 'add an int and an NV and assign to a package var',
865 setup => 'my ($x,$y); ($x,$y,$z) = (1, 2.2, 3.3);',
866 code => '$z = $x + $y',
868 'expr::arith::add_lex_ss' => {
869 desc => 'add two short strings and assign to a lexical var',
870 setup => 'my ($x,$y,$z) = ("1", "2", 1);',
871 code => '$z = $x + $y; $x = "1"; ',
874 'expr::arith::add_lex_ll' => {
875 desc => 'add two long strings and assign to a lexical var',
876 setup => 'my ($x,$y,$z) = ("12345", "23456", 1);',
877 code => '$z = $x + $y; $x = "12345"; ',
880 'expr::arith::sub_lex_ii' => {
881 desc => 'subtract two integers and assign to a lexical var',
882 setup => 'my ($x,$y,$z) = 1..3;',
883 code => '$z = $x - $y',
885 'expr::arith::sub_pkg_ii' => {
886 desc => 'subtract two integers and assign to a package var',
887 setup => 'my ($x,$y) = 1..2; $z = 3;',
888 code => '$z = $x - $y',
890 'expr::arith::sub_lex_nn' => {
891 desc => 'subtract two NVs and assign to a lexical var',
892 setup => 'my ($x,$y,$z) = (1.1, 2.2, 3.3);',
893 code => '$z = $x - $y',
895 'expr::arith::sub_pkg_nn' => {
896 desc => 'subtract two NVs and assign to a package var',
897 setup => 'my ($x,$y); ($x,$y,$z) = (1.1, 2.2, 3.3);',
898 code => '$z = $x - $y',
900 'expr::arith::sub_lex_ni' => {
901 desc => 'subtract an int and an NV and assign to a lexical var',
902 setup => 'my ($x,$y,$z) = (1, 2.2, 3.3);',
903 code => '$z = $x - $y',
905 'expr::arith::sub_pkg_ni' => {
906 desc => 'subtract an int and an NV and assign to a package var',
907 setup => 'my ($x,$y); ($x,$y,$z) = (1, 2.2, 3.3);',
908 code => '$z = $x - $y',
911 'expr::arith::mult_lex_ii' => {
912 desc => 'multiply two integers and assign to a lexical var',
913 setup => 'my ($x,$y,$z) = 1..3;',
914 code => '$z = $x * $y',
916 'expr::arith::mult_pkg_ii' => {
917 desc => 'multiply two integers and assign to a package var',
918 setup => 'my ($x,$y) = 1..2; $z = 3;',
919 code => '$z = $x * $y',
921 'expr::arith::mult_lex_nn' => {
922 desc => 'multiply two NVs and assign to a lexical var',
923 setup => 'my ($x,$y,$z) = (1.1, 2.2, 3.3);',
924 code => '$z = $x * $y',
926 'expr::arith::mult_pkg_nn' => {
927 desc => 'multiply two NVs and assign to a package var',
928 setup => 'my ($x,$y); ($x,$y,$z) = (1.1, 2.2, 3.3);',
929 code => '$z = $x * $y',
931 'expr::arith::mult_lex_ni' => {
932 desc => 'multiply an int and an NV and assign to a lexical var',
933 setup => 'my ($x,$y,$z) = (1, 2.2, 3.3);',
934 code => '$z = $x * $y',
936 'expr::arith::mult_pkg_ni' => {
937 desc => 'multiply an int and an NV and assign to a package var',
938 setup => 'my ($x,$y); ($x,$y,$z) = (1, 2.2, 3.3);',
939 code => '$z = $x * $y',
942 'expr::arith::preinc' => {
944 setup => 'my $x = 1;',
947 'expr::arith::predec' => {
949 setup => 'my $x = 1;',
952 'expr::arith::postinc' => {
954 setup => 'my $x = 1; my $y',
955 code => '$y = $x++', # scalar context so not optimised to ++$x
957 'expr::arith::postdec' => {
959 setup => 'my $x = 1; my $y',
960 code => '$y = $x--', # scalar context so not optimised to --$x
965 # scalar assign, OP_SASSIGN
968 'expr::sassign::scalar_lex_int' => {
969 desc => 'lexical $x = 1',
973 'expr::sassign::scalar_lex_str' => {
974 desc => 'lexical $x = "abc"',
976 code => '$x = "abc"',
978 'expr::sassign::scalar_lex_strint' => {
979 desc => 'lexical $x = 1 where $x was previously a string',
980 setup => 'my $x = "abc"',
983 'expr::sassign::scalar_lex_intstr' => {
984 desc => 'lexical $x = "abc" where $x was previously an int',
985 setup => 'my $x = 1;',
986 code => '$x = "abc"',
988 'expr::sassign::lex_rv' => {
989 desc => 'lexical $ref1 = $ref2;',
990 setup => 'my $r1 = []; my $r = $r1;',
993 'expr::sassign::lex_rv1' => {
994 desc => 'lexical $ref1 = $ref2; where $$ref1 gets freed',
995 setup => 'my $r1 = []; my $r',
996 code => '$r = []; $r = $r1;',
1001 # using a const string as second arg to index triggers using FBM.
1002 # the FBM matcher special-cases 1,2-byte strings.
1004 'func::index::short_const1' => {
1005 desc => 'index of a short string against a 1 char const substr',
1006 setup => 'my $x = "aaaab"',
1007 code => 'index $x, "b"',
1009 'func::index::long_const1' => {
1010 desc => 'index of a long string against a 1 char const substr',
1011 setup => 'my $x = "a" x 1000 . "b"',
1012 code => 'index $x, "b"',
1014 'func::index::short_const2aabc_bc' => {
1015 desc => 'index of a short string against a 2 char const substr',
1016 setup => 'my $x = "aaaabc"',
1017 code => 'index $x, "bc"',
1019 'func::index::long_const2aabc_bc' => {
1020 desc => 'index of a long string against a 2 char const substr',
1021 setup => 'my $x = "a" x 1000 . "bc"',
1022 code => 'index $x, "bc"',
1024 'func::index::long_const2aa_ab' => {
1025 desc => 'index of a long string aaa.. against const substr "ab"',
1026 setup => 'my $x = "a" x 1000',
1027 code => 'index $x, "ab"',
1029 'func::index::long_const2bb_ab' => {
1030 desc => 'index of a long string bbb.. against const substr "ab"',
1031 setup => 'my $x = "b" x 1000',
1032 code => 'index $x, "ab"',
1034 'func::index::long_const2aa_bb' => {
1035 desc => 'index of a long string aaa.. against const substr "bb"',
1036 setup => 'my $x = "a" x 1000',
1037 code => 'index $x, "bb"',
1039 # this one is designed to be pathological
1040 'func::index::long_const2ab_aa' => {
1041 desc => 'index of a long string abab.. against const substr "aa"',
1042 setup => 'my $x = "ab" x 500',
1043 code => 'index $x, "aa"',
1045 # near misses with gaps, 1st letter
1046 'func::index::long_const2aaxx_xy' => {
1047 desc => 'index of a long string with "xx"s against const substr "xy"',
1048 setup => 'my $x = "aaaaaaaaxx" x 100',
1049 code => 'index $x, "xy"',
1051 # near misses with gaps, 2nd letter
1052 'func::index::long_const2aayy_xy' => {
1053 desc => 'index of a long string with "yy"s against const substr "xy"',
1054 setup => 'my $x = "aaaaaaaayy" x 100',
1055 code => 'index $x, "xy"',
1057 # near misses with gaps, duplicate letter
1058 'func::index::long_const2aaxy_xx' => {
1059 desc => 'index of a long string with "xy"s against const substr "xx"',
1060 setup => 'my $x = "aaaaaaaaxy" x 100',
1061 code => 'index $x, "xx"',
1063 # alternating near misses with gaps
1064 'func::index::long_const2aaxxaayy_xy' => {
1065 desc => 'index of a long string with "xx/yy"s against const substr "xy"',
1066 setup => 'my $x = "aaaaaaaaxxbbbbbbbbyy" x 50',
1067 code => 'index $x, "xy"',
1069 'func::index::short_const3aabcd_bcd' => {
1070 desc => 'index of a short string against a 3 char const substr',
1071 setup => 'my $x = "aaaabcd"',
1072 code => 'index $x, "bcd"',
1074 'func::index::long_const3aabcd_bcd' => {
1075 desc => 'index of a long string against a 3 char const substr',
1076 setup => 'my $x = "a" x 1000 . "bcd"',
1077 code => 'index $x, "bcd"',
1079 'func::index::long_const3ab_abc' => {
1080 desc => 'index of a long string of "ab"s against a 3 char const substr "abc"',
1081 setup => 'my $x = "ab" x 500',
1082 code => 'index $x, "abc"',
1084 'func::index::long_const3bc_abc' => {
1085 desc => 'index of a long string of "bc"s against a 3 char const substr "abc"',
1086 setup => 'my $x = "bc" x 500',
1087 code => 'index $x, "abc"',
1089 'func::index::utf8_position_1' => {
1090 desc => 'index of a utf8 string, matching at position 1',
1091 setup => 'my $x = "abc". chr(0x100); chop $x',
1092 code => 'index $x, "b"',
1097 'func::sort::num' => {
1098 desc => 'plain numeric sort',
1099 setup => 'my (@a, @b); @a = reverse 1..10;',
1100 code => '@b = sort { $a <=> $b } @a',
1102 'func::sort::num_block' => {
1103 desc => 'codeblock numeric sort',
1104 setup => 'my (@a, @b); @a = reverse 1..10;',
1105 code => '@b = sort { $a + 1 <=> $b + 1 } @a',
1107 'func::sort::num_fn' => {
1108 desc => 'function numeric sort',
1109 setup => 'sub f { $a + 1 <=> $b + 1 } my (@a, @b); @a = reverse 1..10;',
1110 code => '@b = sort f @a',
1112 'func::sort::str' => {
1113 desc => 'plain string sort',
1114 setup => 'my (@a, @b); @a = reverse "a".."j";',
1115 code => '@b = sort { $a cmp $b } @a',
1117 'func::sort::str_block' => {
1118 desc => 'codeblock string sort',
1119 setup => 'my (@a, @b); @a = reverse "a".."j";',
1120 code => '@b = sort { ($a . "") cmp ($b . "") } @a',
1122 'func::sort::str_fn' => {
1123 desc => 'function string sort',
1124 setup => 'sub f { ($a . "") cmp ($b . "") } my (@a, @b); @a = reverse "a".."j";',
1125 code => '@b = sort f @a',
1128 'func::sort::num_inplace' => {
1129 desc => 'plain numeric sort in-place',
1130 setup => 'my @a = reverse 1..10;',
1131 code => '@a = sort { $a <=> $b } @a',
1133 'func::sort::num_block_inplace' => {
1134 desc => 'codeblock numeric sort in-place',
1135 setup => 'my @a = reverse 1..10;',
1136 code => '@a = sort { $a + 1 <=> $b + 1 } @a',
1138 'func::sort::num_fn_inplace' => {
1139 desc => 'function numeric sort in-place',
1140 setup => 'sub f { $a + 1 <=> $b + 1 } my @a = reverse 1..10;',
1141 code => '@a = sort f @a',
1143 'func::sort::str_inplace' => {
1144 desc => 'plain string sort in-place',
1145 setup => 'my @a = reverse "a".."j";',
1146 code => '@a = sort { $a cmp $b } @a',
1148 'func::sort::str_block_inplace' => {
1149 desc => 'codeblock string sort in-place',
1150 setup => 'my @a = reverse "a".."j";',
1151 code => '@a = sort { ($a . "") cmp ($b . "") } @a',
1153 'func::sort::str_fn_inplace' => {
1154 desc => 'function string sort in-place',
1155 setup => 'sub f { ($a . "") cmp ($b . "") } my @a = reverse "a".."j";',
1156 code => '@a = sort f @a',
1160 'func::split::vars' => {
1161 desc => 'split into two lexical vars',
1162 setup => 'my $s = "abc:def";',
1163 code => 'my ($x, $y) = split /:/, $s, 2;',
1166 'func::split::array' => {
1167 desc => 'split into a lexical array',
1168 setup => 'my @a; my $s = "abc:def";',
1169 code => '@a = split /:/, $s, 2;',
1171 'func::split::myarray' => {
1172 desc => 'split into a lexical array declared in the assign',
1173 setup => 'my $s = "abc:def";',
1174 code => 'my @a = split /:/, $s, 2;',
1176 'func::split::arrayexpr' => {
1177 desc => 'split into an @{$expr} ',
1178 setup => 'my $s = "abc:def"; my $r = []',
1179 code => '@$r = split /:/, $s, 2;',
1181 'func::split::arraylist' => {
1182 desc => 'split into an array with extra arg',
1183 setup => 'my @a; my $s = "abc:def";',
1184 code => '@a = (split(/:/, $s, 2), 1);',
1189 desc => 'empty basic loop',
1195 desc => 'basic do block',
1196 setup => 'my $x; my $y = 2;',
1197 code => '$x = do {1; $y}', # the ';' stops the do being optimised
1200 'loop::for::my_range1' => {
1201 desc => 'empty for loop with my var and 1 integer range',
1203 code => 'for my $x (1..1) {}',
1205 'loop::for::lex_range1' => {
1206 desc => 'empty for loop with lexical var and 1 integer range',
1208 code => 'for $x (1..1) {}',
1210 'loop::for::pkg_range1' => {
1211 desc => 'empty for loop with package var and 1 integer range',
1213 code => 'for $x (1..1) {}',
1215 'loop::for::defsv_range1' => {
1216 desc => 'empty for loop with $_ and integer 1 range',
1218 code => 'for (1..1) {}',
1220 'loop::for::my_range4' => {
1221 desc => 'empty for loop with my var and 4 integer range',
1223 code => 'for my $x (1..4) {}',
1225 'loop::for::lex_range4' => {
1226 desc => 'empty for loop with lexical var and 4 integer range',
1228 code => 'for $x (1..4) {}',
1230 'loop::for::pkg_range4' => {
1231 desc => 'empty for loop with package var and 4 integer range',
1233 code => 'for $x (1..4) {}',
1235 'loop::for::defsv_range4' => {
1236 desc => 'empty for loop with $_ and integer 4 range',
1238 code => 'for (1..4) {}',
1241 'loop::for::my_list1' => {
1242 desc => 'empty for loop with my var and 1 integer list',
1244 code => 'for my $x (1) {}',
1246 'loop::for::lex_list1' => {
1247 desc => 'empty for loop with lexical var and 1 integer list',
1249 code => 'for $x (1) {}',
1251 'loop::for::pkg_list1' => {
1252 desc => 'empty for loop with package var and 1 integer list',
1254 code => 'for $x (1) {}',
1256 'loop::for::defsv_list1' => {
1257 desc => 'empty for loop with $_ and integer 1 list',
1259 code => 'for (1) {}',
1261 'loop::for::my_list4' => {
1262 desc => 'empty for loop with my var and 4 integer list',
1264 code => 'for my $x (1,2,3,4) {}',
1266 'loop::for::lex_list4' => {
1267 desc => 'empty for loop with lexical var and 4 integer list',
1269 code => 'for $x (1,2,3,4) {}',
1271 'loop::for::pkg_list4' => {
1272 desc => 'empty for loop with package var and 4 integer list',
1274 code => 'for $x (1,2,3,4) {}',
1276 'loop::for::defsv_list4' => {
1277 desc => 'empty for loop with $_ and integer 4 list',
1279 code => 'for (1,2,3,4) {}',
1282 'loop::for::my_array1' => {
1283 desc => 'empty for loop with my var and 1 integer array',
1284 setup => 'my @a = (1);',
1285 code => 'for my $x (@a) {}',
1287 'loop::for::lex_array1' => {
1288 desc => 'empty for loop with lexical var and 1 integer array',
1289 setup => 'my $x; my @a = (1);',
1290 code => 'for $x (@a) {}',
1292 'loop::for::pkg_array1' => {
1293 desc => 'empty for loop with package var and 1 integer array',
1294 setup => '$x = 1; my @a = (1);',
1295 code => 'for $x (@a) {}',
1297 'loop::for::defsv_array1' => {
1298 desc => 'empty for loop with $_ and integer 1 array',
1299 setup => 'my @a = (@a);',
1300 code => 'for (1) {}',
1302 'loop::for::my_array4' => {
1303 desc => 'empty for loop with my var and 4 integer array',
1304 setup => 'my @a = (1..4);',
1305 code => 'for my $x (@a) {}',
1307 'loop::for::lex_array4' => {
1308 desc => 'empty for loop with lexical var and 4 integer array',
1309 setup => 'my $x; my @a = (1..4);',
1310 code => 'for $x (@a) {}',
1312 'loop::for::pkg_array4' => {
1313 desc => 'empty for loop with package var and 4 integer array',
1314 setup => '$x = 1; my @a = (1..4);',
1315 code => 'for $x (@a) {}',
1317 'loop::for::defsv_array4' => {
1318 desc => 'empty for loop with $_ and integer 4 array',
1319 setup => 'my @a = (1..4);',
1320 code => 'for (@a) {}',
1323 'loop::for::next4' => {
1324 desc => 'for loop containing only next with my var and integer 4 array',
1325 setup => 'my @a = (1..4);',
1326 code => 'for my $x (@a) {next}',
1329 'loop::grep::expr_3int' => {
1330 desc => 'grep $_ > 0, 1,2,3',
1332 code => '@a = grep $_ > 0, 1,2,3',
1335 'loop::grep::block_3int' => {
1336 desc => 'grep { 1; $_ > 0} 1,2,3',
1338 code => '@a = grep { 1; $_ > 0} 1,2,3',
1341 'loop::map::expr_3int' => {
1342 desc => 'map $_+1, 1,2,3',
1344 code => '@a = map $_+1, 1,2,3',
1347 'loop::map::block_3int' => {
1348 desc => 'map { 1; $_+1} 1,2,3',
1350 code => '@a = map { 1; $_+1} 1,2,3',
1353 'loop::while::i1' => {
1354 desc => 'empty while loop 1 iteration',
1355 setup => 'my $i = 0;',
1356 code => 'while (++$i % 2) {}',
1358 'loop::while::i4' => {
1359 desc => 'empty while loop 4 iterations',
1360 setup => 'my $i = 0;',
1361 code => 'while (++$i % 4) {}',
1365 'regex::anyof_plus::anchored' => {
1366 desc => '/^[acgt]+/',
1367 setup => '$_ = "a" x 100;',
1368 code => '/^[acgt]+/',
1370 'regex::anyof_plus::floating' => {
1371 desc => '/[acgt]+where match starts at position 0 for 100 chars/',
1372 setup => '$_ = "a" x 100;',
1373 code => '/[acgt]+/',
1375 'regex::anyof_plus::floating_away' => {
1376 desc => '/[acgt]+/ where match starts at position 100 for 100 chars',
1377 setup => '$_ = ("0" x 100) . ("a" x 100);',
1378 code => '/[acgt]+/',