-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test option to run collissions only and related scripts.
- Loading branch information
Showing
14 changed files
with
231 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
data | ||
data.cmp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
1000, 0 | ||
2000, 0.24 | ||
3000, 1.44 | ||
4000, 5.16 | ||
5000, 15.24 | ||
6000, 34.2 | ||
7000, 63.96 | ||
8000, 113.92 | ||
9000, 175.72 | ||
10000, 269.24 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
10000, 0.16 | ||
20000, 2.64 | ||
30000, 15.32 | ||
40000, 60.36 | ||
50000, 158.32 | ||
60000, 336.48 | ||
70000, 649.32 | ||
80000, 1109.2 | ||
90000, 1784.48 | ||
100000, 2691.52 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
1000000, 0 | ||
2000000, 0 | ||
3000000, 0.04 | ||
4000000, 0.32 | ||
5000000, 2.6 | ||
6000000, 13.96 | ||
7000000, 57 | ||
8000000, 184.36 | ||
9000000, 509.52 | ||
10000000, 1210.56 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
1000000, 0 | ||
2000000, 0.12 | ||
3000000, 4.8 | ||
4000000, 39.12 | ||
5000000, 180.68 | ||
6000000, 620.88 | ||
7000000, 1749.44 | ||
8000000, 4168.48 | ||
9000000, 8716.72 | ||
10000000, 16666.44 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
1000000, 8.96 | ||
2000000, 240.44 | ||
3000000, 1561.84 | ||
4000000, 5801.16 | ||
5000000, 15577.6 | ||
6000000, 34093.12 | ||
7000000, 64954.48 | ||
8000000, 112030.32 | ||
9000000, 178613.72 | ||
10000000, 268721.6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
1000, 0 | ||
2000, 0.48 | ||
3000, 1.4 | ||
4000, 5.24 | ||
5000, 15.84 | ||
6000, 33.68 | ||
7000, 68.12 | ||
8000, 110.6 | ||
9000, 178.96 | ||
10000, 268.84 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
10000, 0.08 | ||
20000, 2.44 | ||
30000, 18.16 | ||
40000, 59.88 | ||
50000, 151.84 | ||
60000, 342.52 | ||
70000, 656.04 | ||
80000, 1113.56 | ||
90000, 1795.76 | ||
100000, 2690.04 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
1000000, 0 | ||
2000000, 0 | ||
3000000, 0.04 | ||
4000000, 0.24 | ||
5000000, 3.44 | ||
6000000, 12.84 | ||
7000000, 55.8 | ||
8000000, 183.88 | ||
9000000, 493.92 | ||
10000000, 1224.08 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
1000000, 0 | ||
2000000, 0.36 | ||
3000000, 4.04 | ||
4000000, 38.52 | ||
5000000, 175.08 | ||
6000000, 631.96 | ||
7000000, 1764.8 | ||
8000000, 4164.16 | ||
9000000, 8780.44 | ||
10000000, 16635.36 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
1000000, 7.44 | ||
2000000, 231.64 | ||
3000000, 1567.76 | ||
4000000, 5794.88 | ||
5000000, 15564.04 | ||
6000000, 34060.92 | ||
7000000, 64926.88 | ||
8000000, 111990.88 | ||
9000000, 178743 | ||
10000000, 268803.76 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#!/usr/bin/env perl | ||
|
||
# | ||
# Copyright (c) 2015, Jyri J. Virkki | ||
# All rights reserved. | ||
# | ||
# This file is under BSD license. See LICENSE file. | ||
# | ||
|
||
# | ||
# ./colcmp FILE1 FILE2 | ||
# | ||
# Compare two collision average runs (generated with colgraph). | ||
# The runs must be for the same SIZE (see colgraph). | ||
# | ||
# Requires ploticus to generate the graph. | ||
# | ||
|
||
$file1 = shift(@ARGV); | ||
$file2 = shift(@ARGV); | ||
|
||
if (! -e $file1 || ! -e $file2) { | ||
die "File not found\n"; | ||
} | ||
|
||
open(F1, $file1); | ||
open(F2, $file2); | ||
open(OUT, ">data.cmp"); | ||
|
||
while(<F1>) { | ||
($count1, $avg1) = /(\d+), (\S+)/; | ||
$_ = <F2>; | ||
($count2, $avg2) = /(\d+), (\S+)/; | ||
if ($count1 ne $count2) { | ||
die "mismatch $count1 $count2\n"; | ||
} | ||
print OUT "$count2 $avg1 $avg2\n"; | ||
} | ||
|
||
close(F1); | ||
close(F2); | ||
close(OUT); | ||
|
||
$cmd = "ploticus -prefab lines data=data.cmp x=1 y=2 y2=3 " . | ||
"\"xrange=0 $count2\" \"title=size = $count2\" " . | ||
"\"ylbl=collisions\" \"xlbl=count\" \"name=$file1\" " . | ||
"\"name2=$file2\" "; | ||
print "$cmd\n"; | ||
system($cmd); | ||
|
||
unlink "data.cmp"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#!/usr/bin/env perl | ||
|
||
# | ||
# Copyright (c) 2015, Jyri J. Virkki | ||
# All rights reserved. | ||
# | ||
# This file is under BSD license. See LICENSE file. | ||
# | ||
|
||
# | ||
# ./colgraph SIZE ERROR | ||
# | ||
# SIZE = size of bloom library to initialize | ||
# ERROR = expected error | ||
# | ||
# This script runs a random collision test (test-libbloom -c) $rounds | ||
# number of times for 10 element counts from SIZE/10 to SIZE. The | ||
# average of each run is saved in the 'data' file in the current | ||
# directory. | ||
# | ||
# If ploticus is available it'll also display a graph. Or you can use | ||
# any other graphing app or tool to process the 'data' file. | ||
# | ||
|
||
$rounds = 25; | ||
|
||
$size = shift(@ARGV); | ||
if (!$size) { | ||
die "provide a size\n"; | ||
} | ||
|
||
$error = shift(@ARGV); | ||
if (!$error) { | ||
die "provide expected error\n"; | ||
} | ||
|
||
open(OUT, ">data"); | ||
for ($tenth = 1; $tenth < 11; $tenth++) { | ||
$count = ($size / 10) * $tenth; | ||
|
||
$avg = 0; | ||
for ($n = 0; $n < $rounds; $n++) { | ||
open(RES, "../build/test-libbloom -c $size $error $count |"); | ||
while(<RES>) {$got = $_;} | ||
close(RES); | ||
($added, $coll) = $got =~ /added (\d+), collisions (\d+)/; | ||
$avg += $coll; | ||
} | ||
$avg /= $rounds; | ||
print "ADDED $added, AVG.COLL $avg\n"; | ||
print OUT "$added, $avg\n"; | ||
} | ||
close(OUT); | ||
|
||
$cmd = "ploticus -prefab lines data=data x=1 y=2 \"xrange=0 $size\" " . | ||
"\"title=size = $size\" \"ylbl=collisions\" \"xlbl=count\" "; | ||
print "$cmd\n"; | ||
system($cmd); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters