
$N = 100_000; 
$s = 'aaaaaaaaaaab';

my ($su, $ss) = times;
for ($i=0; $i< $N; $i++) {
}
my ($eu, $es) = times;
my ($tu, $ts) = ($eu-$su, $es-$ss);
my $t = $tu+$ts;
print "NULL: u=$tu + s=$ts = $t\n";

my ($su, $ss) = times;
for ($i=0; $i< $N; $i++) {
  $s =~ /a*aaaaaaab/;
}
my ($eu, $es) = times;
my ($tu, $ts) = ($eu-$su, $es-$ss);
my $t = $tu+$ts;
print "MATCH: u=$tu + s=$ts = $t\n";

my ($su, $ss) = times;
for ($i=0; $i< $N; $i++) {
  $s =~ s/a/a/i;
}
my ($eu, $es) = times;
my ($tu, $ts) = ($eu-$su, $es-$ss);
my $t = $tu+$ts;
print "SUBST: u=$tu + s=$ts = $t\n";

################################################################
eval '$dummy = $&';
my ($su, $ss) = times;
for ($i=0; $i< $N; $i++) {
  $s =~ /a*aaaaaaab/;
}
my ($eu, $es) = times;
my ($tu, $ts) = ($eu-$su, $es-$ss);
my $t = $tu+$ts;
print "MATCH WITH AMPER: u=$tu + s=$ts = $t\n";

my ($su, $ss) = times;
for ($i=0; $i< $N; $i++) {
  $s =~ s/a/a/i;
}
my ($eu, $es) = times;
my ($tu, $ts) = ($eu-$su, $es-$ss);
my $t = $tu+$ts;
print "SUBST WITH AMPER: u=$tu + s=$ts = $t\n";




