time ./scripts/dump_isis.pl > isis.txt
time ./scripts/dump_openisis.pl > openisis.txt
time ./scripts/dump_isis.pl > isis.txt
time ./scripts/dump_openisis.pl > openisis.txt
+bench: all
+ cd ./scripts/ && ./bench.pl
+
+my $isis_filter = IsisDB->new (
+ isisdb => $isisdb,
+ debug => shift @ARGV,
+ hash_filter => sub {
+ my $v = shift;
+ return lc($v);
+ }
+);
+
my $rows = $isis->{'maxmfn'};
my $db = OpenIsis::open( $isisdb );
my $rows = $isis->{'maxmfn'};
my $db = OpenIsis::open( $isisdb );
IsisDB => sub {
$isis->fetch( $mfn++ % $rows + 1 );
},
IsisDB => sub {
$isis->fetch( $mfn++ % $rows + 1 );
},
+ IsisDB_hash => sub {
+ $isis->to_hash( $mfn++ % $rows + 1 );
+ },
+ IsisDB_hash_filter => sub {
+ $isis_filter->to_hash( $mfn++ % $rows + 1 );
+ },
+
OpenIsis => sub {
OpenIsis::read( $db, $mfn++ % $rows + 1 );
},
OpenIsis => sub {
OpenIsis::read( $db, $mfn++ % $rows + 1 );
},
+
+ OpenIsis_hash => sub {
+ my $row = OpenIsis::read( $db, $mfn++ % $rows + 1 );
+ my $rec;
+ no strict 'refs';
+ foreach my $f (keys %{$row}) {
+ foreach my $v (@{$row->{$f}}) {
+ push @{$rec->{$f}}, OpenIsis::subfields($v);
+ }
+ }
+
+ },