From 76b36bd364ecac5621317ebe4e92a98470eb8c35 Mon Sep 17 00:00:00 2001 From: tipaul Date: Wed, 23 Jun 2004 13:01:12 +0000 Subject: [PATCH] removing old stuff --- marc/benchmarks/benchmarkresults | 6 --- marc/benchmarks/benchmarkschema | 36 ------------- marc/benchmarks/generaterandomdata | 82 ------------------------------ marc/benchmarks/getdata-paul | 32 ------------ marc/benchmarks/getdata-paul-regex | 33 ------------ marc/benchmarks/getdata-sergey | 32 ------------ marc/benchmarks/getdata-steve | 34 ------------- marc/benchmarks/runbenchmark | 23 --------- 8 files changed, 278 deletions(-) delete mode 100644 marc/benchmarks/benchmarkresults delete mode 100644 marc/benchmarks/benchmarkschema delete mode 100644 marc/benchmarks/generaterandomdata delete mode 100644 marc/benchmarks/getdata-paul delete mode 100644 marc/benchmarks/getdata-paul-regex delete mode 100644 marc/benchmarks/getdata-sergey delete mode 100644 marc/benchmarks/getdata-steve delete mode 100644 marc/benchmarks/runbenchmark diff --git a/marc/benchmarks/benchmarkresults b/marc/benchmarks/benchmarkresults deleted file mode 100644 index 4191d587a0..0000000000 --- a/marc/benchmarks/benchmarkresults +++ /dev/null @@ -1,6 +0,0 @@ -Benchmark results from Steve Tonnesen - -getdata-steve: 15.73 13.26 14.47 12.73 11.90 -getdata-paul: 21.56 14.11 12.58 12.49 13.18 -getdata-paul-regex: 14.32 11.53 13.51 10.15 10.99 - diff --git a/marc/benchmarks/benchmarkschema b/marc/benchmarks/benchmarkschema deleted file mode 100644 index 0b04dd8ead..0000000000 --- a/marc/benchmarks/benchmarkschema +++ /dev/null @@ -1,36 +0,0 @@ -CREATE TABLE marc_subfield_table ( - subfieldid bigint(20) unsigned NOT NULL auto_increment, - tagid bigint(20) NOT NULL default '0', - tag char(3) NOT NULL default '', - bibid bigint(20) NOT NULL default '0', - subfieldorder tinyint(4) NOT NULL default '0', - subfieldcode char(1) NOT NULL default '', - subfieldvalue varchar(255) default NULL, - valuebloblink bigint(20) default NULL, - PRIMARY KEY (subfieldid), - KEY (bibid,tagid,tag,subfieldcode), - KEY (bibid,tag,subfieldcode,subfieldvalue) - ) TYPE=MyISAM; - - -CREATE TABLE marc_field_table_sergey ( - fieldid bigint(20) unsigned NOT NULL auto_increment, - bibid bigint(20) NOT NULL default '0', - tagid bigint(20) NOT NULL default '0', - tag char(3) NOT NULL default '', - PRIMARY KEY (fieldid), - KEY (bibid), - KEY (tagid), - KEY (tag) -); - -CREATE TABLE marc_subfield_table_sergey ( - subfieldid bigint(20) unsigned NOT NULL auto_increment, - fieldid bigint(20), - subfieldorder tinyint(4) NOT NULL default '0', - subfieldcode char(1) NOT NULL default '', - subfieldvalue varchar(255) default NULL, - valuebloblink bigint(20) default NULL, - PRIMARY KEY (subfieldid), - KEY (fieldid) -); diff --git a/marc/benchmarks/generaterandomdata b/marc/benchmarks/generaterandomdata deleted file mode 100644 index 2fdd086f0e..0000000000 --- a/marc/benchmarks/generaterandomdata +++ /dev/null @@ -1,82 +0,0 @@ -#!/usr/bin/perl -# -# This script generates 80,000 random records in the kohabenchmark database for -# the purposes of comparing two different marc storage schemas. It requires -# the presence of a word list for populating the data. Mine is in -# /usr/share/dict/words. Change that if necessary. You'll also need to change -# your userid and password for the dbi->connect line. - -use DBI; - -my $dbh=DBI->connect("dbi:mysql:kohabenchmark", 'youruserid', 'yourpassword'); -@subfields = ( 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n'); - - -open (W, "/usr/share/dict/words"); -while () { - chomp; - push @words, $_; -} - -my $tagcounter=0; -my $subfieldcounter=0; -srand($$|time); -for ($bibid=1; $bibid<80000; $bibid++) { - my $numtags=int(rand(10)+5); - my $localtagcounter=0; - for ($i=1; $i<$numtags; $i++) { - $localtagcounter++; - $tagcounter++; - my $tag=$i*40+100; - my $numsubfields=int(rand(10)+1); - my $subfieldsused; - my $localsubfieldcounter=0; - for ($j=1; $j<=$numsubfields; $j++) { - my $code=''; - until ($code) { - my $codepicker=int(rand($#subfields)); - if ($subfieldsused->{$subfields[$codepicker]}==0) { - $subfieldsused->{$subfields[$codepicker]}=1; - $code=$subfields[$codepicker]; - } - } - $subfieldcounter++; - $localsubfieldcounter++; - my $word=$words[int(rand($#words))]; - my $sth=$dbh->prepare("insert into marc_subfield_table (subfieldid, tagid, tag, bibid, subfieldorder, subfieldcode, subfieldvalue) values (?,?,?,?,?,?,?)"); - my $error=1; - while ($error) { - $sth->execute($subfieldcounter, $tagcounter, $tag, $bibid, $localsubfieldcounter, $code, $word); - $error=$dbh->err; - if ($error) { - sleep 1; - print "ERROR: $error\n"; - } - $sth->finish; - } - my $error=1; - my $sth=$dbh->prepare("insert into marc_field_table_sergey (bibid, tagid, tag) values (?, ?, ?)"); - while ($error) { - $sth->execute($bibid, $localtagcounter, $tag); - $error=$dbh->err; - if ($error) { - sleep 1; - print "ERROR: $error\n"; - } - $fieldid=$dbh->{'mysql_insertid'}; - $sth->finish; - } - $error=1; - $sth=$dbh->prepare("insert into marc_subfield_table_sergey (fieldid, subfieldorder, subfieldcode, subfieldvalue) values (?, ?, ?, ?)"); - while ($error) { - $sth->execute($fieldid, $localsubfieldcounter, $code, $word); - $error=$dbh->err; - if ($error) { - sleep 1; - print "ERROR: $error\n"; - } - $sth->finish; - } - } - } -} diff --git a/marc/benchmarks/getdata-paul b/marc/benchmarks/getdata-paul deleted file mode 100644 index 04e8597d95..0000000000 --- a/marc/benchmarks/getdata-paul +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/perl -# -# -# Benchmark script for Paul's marc db schema using split() to separate subfield -# code from subfield value - -use DBI; - - -my $dbh=DBI->connect("dbi:mysql:kohabenchmark", 'youruserid', 'yourpassword'); - -my $count=$ARGV[0]; -my $print=$ARGV[1]; -my $bibid=$ARGV[2]; - - - -for ($i=0; $i<$count; $i++) { - ($bibid) || ($bibid=int(rand(79998))+1); - - ($print) && (print "BIBID: $bibid\n"); - my $sth=$dbh->prepare("select tagnumber,tagvalue from marc_0XX_tag_table where bibcode=$bibid order by tagorder"); - $sth->execute; - while (my ($tagnumber, $tagvalue) = $sth->fetchrow) { - ($print) && (print " Tag: $tagnumber\n"); - foreach (split(/\0/, $tagvalue)) { - my ($code, $value) = split(/\s/, $_, 2); - ($print) && (print " $code $value\n"); - } - } - $bibid=0; -} diff --git a/marc/benchmarks/getdata-paul-regex b/marc/benchmarks/getdata-paul-regex deleted file mode 100644 index f56a79a851..0000000000 --- a/marc/benchmarks/getdata-paul-regex +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/perl -# -# -# Benchmark script for Paul's marc db schema using regex to separate subfield -# code from subfield value - -use DBI; - - -my $dbh=DBI->connect("dbi:mysql:kohabenchmark", 'youruserid', 'yourpassword'); - -my $count=$ARGV[0]; -my $print=$ARGV[1]; -my $bibid=$ARGV[2]; - - - -for ($i=0; $i<$count; $i++) { - ($bibid) || ($bibid=int(rand(79998))+1); - - ($print) && (print "BIBID: $bibid\n"); - my $sth=$dbh->prepare("select tagnumber,tagvalue from marc_0XX_tag_table where bibcode=$bibid order by tagorder"); - $sth->execute; - while (my ($tagnumber, $tagvalue) = $sth->fetchrow) { - ($print) && (print " Tag: $tagnumber\n"); - foreach (split(/\0/, $tagvalue)) { - m#$(.) (.*)#; - my ($code, $value) = ($1, $2); - ($print) && (print " $code $value\n"); - } - } - $bibid=0; -} diff --git a/marc/benchmarks/getdata-sergey b/marc/benchmarks/getdata-sergey deleted file mode 100644 index be4e15dfd5..0000000000 --- a/marc/benchmarks/getdata-sergey +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/perl -# -# -# Benchmark script for Sergey's marc db schema - - -use DBI; - -my $dbh=DBI->connect("dbi:mysql:kohabenchmark", 'youruserid', 'yourpassword'); - -my $count=$ARGV[0]; -my $print=$ARGV[1]; -my $max=$ARGV[2]; -my $bibid=$ARGV[3]; -($max) || ($max=79998); - - -for ($i=0; $i<$count; $i++) { - ($bibid) || ($bibid=int(rand($max))+1); - ($print) && (print "BIBID: $bibid\n"); - my $sth=$dbh->prepare("select F.tag,S.subfieldcode,S.subfieldvalue from marc_field_table_sergey F,marc_subfield_table_sergey S where F.fieldid=S.fieldid and F.bibid=$bibid order by F.fieldid,S.subfieldorder"); - $sth->execute; - my $lasttag=''; - while (my ($tag,$subfieldcode,$subfieldvalue) = $sth->fetchrow) { - if ($tag ne $lasttag) { - ($print) && (print " Tag: $tag\n"); - $lasttag=$tag; - } - ($print) && (print " $subfieldcode $subfieldvalue\n"); - } - $bibid=0; -} diff --git a/marc/benchmarks/getdata-steve b/marc/benchmarks/getdata-steve deleted file mode 100644 index 6fa1dc231a..0000000000 --- a/marc/benchmarks/getdata-steve +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/perl -# -# -# Benchmark script for Steve's marc db schema - - -use DBI; - - -my $dbh=DBI->connect("dbi:mysql:kohabenchmark", 'youruserid', 'yourpassword'); - -my $count=$ARGV[0]; -my $print=$ARGV[1]; -my $max=$ARGV[2]; -my $bibid=$ARGV[3]; -($max) || ($max=79998); - - -for ($i=0; $i<$count; $i++) { - ($bibid) || ($bibid=int(rand($max))+1); - - ($print) && (print "BIBID: $bibid\n"); - my $sth=$dbh->prepare("select tagid,tag,subfieldcode,subfieldvalue from marc_subfield_table where bibid=$bibid order by tagid,subfieldorder"); - $sth->execute; - my $lasttag=''; - while (my ($tagid,$tag,$subfieldcode,$subfieldvalue) = $sth->fetchrow) { - if ($tag ne $lasttag) { - ($print) && (print " Tag: $tag\n"); - $lasttag=$tag; - } - ($print) && (print " $subfieldcode $subfieldvalue\n"); - } - $bibid=0; -} diff --git a/marc/benchmarks/runbenchmark b/marc/benchmarks/runbenchmark deleted file mode 100644 index 4e37274c06..0000000000 --- a/marc/benchmarks/runbenchmark +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/perl -# -# -# This script will iterate through each benchmark 5 times, looking up 500 -# random records each time. Results will be printed to STDOUT. - -my @benchmarks=('getdata-steve', 'getdata-sergey'); -my $numrecords=$ARGV[0]; -my $numindb=$ARGV[1]; -($numrecords) || ($numrecords=50); -($numindb) || ($numindb=79998); - -my $iterations=5; - -foreach (@benchmarks) { - print "$_:\t"; - for ($i=1; $i<=$iterations; $i++) { - my $timer=`/usr/bin/time -f "%E" perl $_ $numrecords 0 $numindb 2>&1`; - chomp $timer; - print "$timer\t"; - } - print "\n"; -} -- 2.20.1