I
it_says_BALLS_on_your forehead
these are the results:
smmk94<WSP1>$ try_regex2.pl
Benchmark: running greedy, stingy, each for at least 1 CPU seconds...
greedy: 0 wallclock secs ( 1.02 usr + 0.00 sys = 1.02 CPU) @
1235595.10/s (n=1260307)
stingy: 1 wallclock secs ( 1.09 usr + 0.00 sys = 1.09 CPU) @
1172432.11/s (n=1277951)
Rate stingy greedy
stingy 1172432/s -- -5%
greedy 1235595/s 5% --
smmk94<WSP1>$ try_regex2.pl
Benchmark: running greedy, stingy, each for at least 1 CPU seconds...
greedy: 1 wallclock secs ( 1.06 usr + 0.00 sys = 1.06 CPU) @
1180321.70/s (n=1251141)
stingy: 1 wallclock secs ( 1.07 usr + 0.01 sys = 1.08 CPU) @
1261175.00/s (n=1362069)
Rate greedy stingy
greedy 1180322/s -- -6%
stingy 1261175/s 7% --
smmk94<WSP1>$ try_regex2.pl
Benchmark: running greedy, stingy, each for at least 1 CPU seconds...
greedy: 1 wallclock secs ( 1.06 usr + 0.00 sys = 1.06 CPU) @
1180321.70/s (n=1251141)
stingy: 2 wallclock secs ( 1.05 usr + 0.00 sys = 1.05 CPU) @
1260306.67/s (n=1323322)
Rate greedy stingy
greedy 1180322/s -- -6%
stingy 1260307/s 7% --
smmk94<WSP1>$ try_regex2.pl
Benchmark: running greedy, stingy, each for at least 1 CPU seconds...
greedy: 1 wallclock secs ( 1.16 usr + 0.00 sys = 1.16 CPU) @
1248870.69/s (n=1448690)
stingy: 2 wallclock secs ( 1.10 usr + 0.00 sys = 1.10 CPU) @
1137400.91/s (n=1251141)
Rate stingy greedy
stingy 1137401/s -- -9%
greedy 1248871/s 10% --
and here is the code:
=====
#!/usr/local/bin/perl
use strict; use warnings;
use Benchmark qw(cmpthese);
sub alt {
my $input =
'http://activequote.fidelity.com/webxpress/quotes_frame.phtml?QUOTE_TYPE=D&SID_VALUE_ID=.N225';
return 1 if $input =~ /campaign\w*_fulltop\.gif/;
}
sub alt2 {
my $input =
'http://activequote.fidelity.com/webxpress/quotes_frame.phtml?QUOTE_TYPE=D&SID_VALUE_ID=.N225';
return 1 if $input =~ /campaign\w*?_fulltop\.gif/;
}
cmpthese(-1, {
greedy => \&alt,
stingy => \&alt2,
});
....any comments on why there's a flipflop?
smmk94<WSP1>$ try_regex2.pl
Benchmark: running greedy, stingy, each for at least 1 CPU seconds...
greedy: 0 wallclock secs ( 1.02 usr + 0.00 sys = 1.02 CPU) @
1235595.10/s (n=1260307)
stingy: 1 wallclock secs ( 1.09 usr + 0.00 sys = 1.09 CPU) @
1172432.11/s (n=1277951)
Rate stingy greedy
stingy 1172432/s -- -5%
greedy 1235595/s 5% --
smmk94<WSP1>$ try_regex2.pl
Benchmark: running greedy, stingy, each for at least 1 CPU seconds...
greedy: 1 wallclock secs ( 1.06 usr + 0.00 sys = 1.06 CPU) @
1180321.70/s (n=1251141)
stingy: 1 wallclock secs ( 1.07 usr + 0.01 sys = 1.08 CPU) @
1261175.00/s (n=1362069)
Rate greedy stingy
greedy 1180322/s -- -6%
stingy 1261175/s 7% --
smmk94<WSP1>$ try_regex2.pl
Benchmark: running greedy, stingy, each for at least 1 CPU seconds...
greedy: 1 wallclock secs ( 1.06 usr + 0.00 sys = 1.06 CPU) @
1180321.70/s (n=1251141)
stingy: 2 wallclock secs ( 1.05 usr + 0.00 sys = 1.05 CPU) @
1260306.67/s (n=1323322)
Rate greedy stingy
greedy 1180322/s -- -6%
stingy 1260307/s 7% --
smmk94<WSP1>$ try_regex2.pl
Benchmark: running greedy, stingy, each for at least 1 CPU seconds...
greedy: 1 wallclock secs ( 1.16 usr + 0.00 sys = 1.16 CPU) @
1248870.69/s (n=1448690)
stingy: 2 wallclock secs ( 1.10 usr + 0.00 sys = 1.10 CPU) @
1137400.91/s (n=1251141)
Rate stingy greedy
stingy 1137401/s -- -9%
greedy 1248871/s 10% --
and here is the code:
=====
#!/usr/local/bin/perl
use strict; use warnings;
use Benchmark qw(cmpthese);
sub alt {
my $input =
'http://activequote.fidelity.com/webxpress/quotes_frame.phtml?QUOTE_TYPE=D&SID_VALUE_ID=.N225';
return 1 if $input =~ /campaign\w*_fulltop\.gif/;
}
sub alt2 {
my $input =
'http://activequote.fidelity.com/webxpress/quotes_frame.phtml?QUOTE_TYPE=D&SID_VALUE_ID=.N225';
return 1 if $input =~ /campaign\w*?_fulltop\.gif/;
}
cmpthese(-1, {
greedy => \&alt,
stingy => \&alt2,
});
....any comments on why there's a flipflop?