/[Biblio-Isis]/trunk/scripts/bench.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/scripts/bench.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 7 by dpavlin, Wed Dec 29 15:10:34 2004 UTC revision 14 by dpavlin, Wed Dec 29 20:11:34 2004 UTC
# Line 16  my $isis = IsisDB->new ( Line 16  my $isis = IsisDB->new (
16          debug => shift @ARGV,          debug => shift @ARGV,
17  );  );
18    
19    my $isis_filter = IsisDB->new (
20            isisdb => $isisdb,
21            debug => shift @ARGV,
22            hash_filter => sub {
23                    my $v = shift;
24                    return lc($v);
25            }
26    );
27    
28  my $rows = $isis->{'maxmfn'};  my $rows = $isis->{'maxmfn'};
29    
30  my $db = OpenIsis::open( $isisdb );  my $db = OpenIsis::open( $isisdb );
# Line 28  my $r = timethese( -5, { Line 37  my $r = timethese( -5, {
37          IsisDB => sub {          IsisDB => sub {
38                  $isis->fetch( $mfn++ % $rows + 1 );                  $isis->fetch( $mfn++ % $rows + 1 );
39          },          },
40            IsisDB_hash => sub {
41                    $isis->to_hash( $mfn++ % $rows + 1 );
42            },
43            IsisDB_hash_filter => sub {
44                    $isis_filter->to_hash( $mfn++ % $rows + 1 );
45            },
46    
47          OpenIsis => sub {          OpenIsis => sub {
48                  OpenIsis::read( $db, $mfn++ % $rows + 1 );                  OpenIsis::read( $db, $mfn++ % $rows + 1 );
49          },          },
50    
51            OpenIsis_hash => sub {
52                    my $row = OpenIsis::read( $db, $mfn++ % $rows + 1 );
53                    my $rec;
54                    no strict 'refs';
55                    foreach my $f (keys %{$row}) {
56                            foreach my $v (@{$row->{$f}}) {
57                                    push @{$rec->{$f}}, OpenIsis::subfields($v);
58                            }
59                    }
60                    
61            },
62  } );  } );
63  cmpthese $r;  cmpthese $r;
64    

Legend:
Removed from v.7  
changed lines
  Added in v.14

  ViewVC Help
Powered by ViewVC 1.1.26