Skip to content

Commit

Permalink
Add target to run collision interval test (100K to 1M @ 0.001).
Browse files Browse the repository at this point in the history
  • Loading branch information
jvirkki committed Oct 13, 2016
1 parent f780827 commit 6d7422c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
16 changes: 14 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

# Copyright (c) 2012-2015, Jyri J. Virkki
# Copyright (c) 2012-2016, Jyri J. Virkki
# All rights reserved.
#
# This file is under BSD license. See LICENSE file.
Expand All @@ -21,7 +21,7 @@
# make perf_report generate perf reports (see README.perf)
#

BLOOM_VERSION=1.2
BLOOM_VERSION=1.3dev

TOP := $(shell /bin/pwd)
BUILD_OS := $(shell uname)
Expand Down Expand Up @@ -122,3 +122,15 @@ gcov:
./test-libbloom && \
gcov -bf bloom.c)
@echo Remember to make clean to remove instrumented objects

#
# This target runs a test which creates a filter of capacity N and inserts
# N elements, for N in 100,000 to 1,000,000 with an expected error of 0.001.
# To preserve and graph the output, move it to ./data/collisions and use
# the ./data/collisions/dograph script to plot it.
#
# WARNING: This can take a very long time (on a slow machine, multiple days)
# to run.
#
collision_test: $(BUILD)/test-libbloom
$(BUILD)/test-libbloom -G 100000 1000000 10 0.001 | tee collision_data_v$(BLOOM_VERSION)
4 changes: 1 addition & 3 deletions test.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,9 @@ static void perf_loop(int entries, int count)
*/
int main(int argc, char **argv)
{
(void)printf("testing libbloom...\n");

if (argc == 6 && !strncmp(argv[1], "-G", 2)) {
int e;
for (e = atoi(argv[2]); e < atoi(argv[3]); e+= atoi(argv[4])) {
for (e = atoi(argv[2]); e <= atoi(argv[3]); e+= atoi(argv[4])) {
add_random(e, atof(argv[5]), e, 0, 1, 0);
}
exit(0);
Expand Down

0 comments on commit 6d7422c

Please sign in to comment.