/[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 35 by dpavlin, Wed Jan 5 15:46:26 2005 UTC revision 36 by dpavlin, Thu Jan 6 20:48:07 2005 UTC
# Line 3  Line 3 
3  use strict;  use strict;
4  use blib;  use blib;
5    
6  use IsisDB;  use Biblio::Isis;
7  use OpenIsis;  use OpenIsis;
8  use MARC::File::USMARC;  use MARC::File::USMARC;
9    
# Line 11  use Benchmark qw( timethese cmpthese ) ; Line 11  use Benchmark qw( timethese cmpthese ) ;
11    
12  my $isisdb = shift @ARGV || '/data/isis_data/ps/LIBRI/LIBRI';  my $isisdb = shift @ARGV || '/data/isis_data/ps/LIBRI/LIBRI';
13    
14  my $isis = IsisDB->new (  my $isis = Biblio::Isis->new (
15          isisdb => $isisdb,          isisdb => $isisdb,
16          debug => shift @ARGV,          debug => shift @ARGV,
17  );  );
18    
19  my $isis_filter = IsisDB->new (  my $isis_filter = Biblio::Isis->new (
20          isisdb => $isisdb,          isisdb => $isisdb,
21          debug => shift @ARGV,          debug => shift @ARGV,
22          hash_filter => sub {          hash_filter => sub {
# Line 34  print "rows: $rows\n\n"; Line 34  print "rows: $rows\n\n";
34  my $mfn = 1;  my $mfn = 1;
35    
36  my $r = timethese( -5, {  my $r = timethese( -5, {
37          IsisDB => sub {          Isis => sub {
38                  $isis->fetch( $mfn++ % $rows + 1 );                  $isis->fetch( $mfn++ % $rows + 1 );
39          },          },
40          IsisDB_hash => sub {          Isis_hash => sub {
41                  $isis->to_hash( $mfn++ % $rows + 1 );                  $isis->to_hash( $mfn++ % $rows + 1 );
42          },          },
43          IsisDB_hash_filter => sub {          Isis_hash_filter => sub {
44                  $isis_filter->to_hash( $mfn++ % $rows + 1 );                  $isis_filter->to_hash( $mfn++ % $rows + 1 );
45          },          },
46    

Legend:
Removed from v.35  
changed lines
  Added in v.36

  ViewVC Help
Powered by ViewVC 1.1.26