-
Notifications
You must be signed in to change notification settings - Fork 2
/
benchmark
26 lines (22 loc) · 878 Bytes
/
benchmark
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/local/bin/perl -w
use lib qw(lib);
use File::Find::Rule;
use File::Find::Rule::Tweaked;
use Time::HiRes;
use Benchmark qw(:all);
my $manystat = File::Find::Rule
->file->size(">0")->size(">1")->size(">2")->size(">3")->size(">4")
->size(">5")->size(">5")->size(">5")->size(">5")->size(">5")->size(">5")
->size(">5")->size(">5")->size(">5")->size(">5")->size(">5")->size(">5")
->size(">6");
my $tweakmanystat = File::Find::Rule::Tweaked
->file->size(">0")->size(">1")->size(">2")->size(">3")->size(">4")
->size(">5")->size(">5")->size(">5")->size(">5")->size(">5")->size(">5")
->size(">5")->size(">5")->size(">5")->size(">5")->size(">5")->size(">5")
->size(">6");
#for ($manystat, $tweakmanystat) { $_->in('t') }; # disclose the complied
#die;
cmpthese(-2, {
tweaked => sub { $tweakmanystat->in('t') },
old => sub { $manystat->in('t') },
});