summaryrefslogtreecommitdiff
path: root/regress/base
diff options
context:
space:
mode:
authorfukachan <fukachan>2002-01-27 13:20:03 +0000
committerfukachan <fukachan>2002-01-27 13:20:03 +0000
commit82582e76f4ff6ebea83a5dbc7e64ac527595eb98 (patch)
treedda1da38c3078b3c4ce098aa5e102634cf2787cc /regress/base
parentcd17f7899482fbcb118114a9b83cfb33db1520af (diff)
downloadfml8-82582e76f4ff6ebea83a5dbc7e64ac527595eb98.tar.gz
fml8-82582e76f4ff6ebea83a5dbc7e64ac527595eb98.tar.bz2
fml8-82582e76f4ff6ebea83a5dbc7e64ac527595eb98.zip
benchmark pebot vs full
Diffstat (limited to 'regress/base')
-rwxr-xr-xregress/base/search_max_id.pl26
1 files changed, 23 insertions, 3 deletions
diff --git a/regress/base/search_max_id.pl b/regress/base/search_max_id.pl
index 3687a066..369769c1 100755
--- a/regress/base/search_max_id.pl
+++ b/regress/base/search_max_id.pl
@@ -1,18 +1,21 @@
#!/usr/bin/env perl
#-*- perl -*-
#
-# Copyright (C) 2001 Ken'ichi Fukamachi
+# Copyright (C) 2001,2002 Ken'ichi Fukamachi
# All rights reserved. This program is free software; you can
# redistribute it and/or modify it under the same terms as Perl itself.
#
-# $FML: @template.pm,v 1.2 2001/10/27 04:27:18 fukachan Exp $
+# $FML: search_max_id.pl,v 1.1 2001/11/20 07:02:57 fukachan Exp $
#
use strict;
use lib qw(../../fml/lib ../../cpan/lib ../../img/lib);
+use Benchmark;
+
use File::Sequence;
my $obj = new File::Sequence;
+my $max_id = $ENV{'max_id'};
for my $file (@ARGV) {
my %db = ();
@@ -22,9 +25,26 @@ for my $file (@ARGV) {
use Fcntl;
tie %db, 'AnyDBM_File', $f, O_RDWR|O_CREAT, 0644;
+ print STDERR "\nsearch with pebot:\n";
print STDERR "max = ";
+ my $t0 = new Benchmark;
print STDERR $obj->search_max_id( { hash => \%db } );
- print STDERR "\n";
+ my $t1 = new Benchmark;
+ my $td = timediff($t1, $t0);
+ print STDERR " ", timestr($td), "\n";
+
+
+ print STDERR "\nfull search:\n";
+ print STDERR "max = ";
+ my $t0 = new Benchmark;
+ print STDERR $obj->search_max_id( {
+ hash => \%db,
+ full_search => 1,
+ } );
+ my $t1 = new Benchmark;
+ my $td = timediff($t1, $t0);
+ print STDERR " ", timestr($td), "\n";
+
}
exit 0;