From e583625c7843af17769da4b0b5b84545ad5b7caa Mon Sep 17 00:00:00 2001 From: Patrick Pelissier Date: Sat, 8 Jul 2017 15:33:10 +0200 Subject: [PATCH] Renumber the tests. --- bench/Makefile | 95 +++++++++++++++++++++------------------- bench/bench-glib.c | 12 ++--- bench/bench-klib.c | 12 ++--- bench/bench-libdynamic.c | 6 +-- bench/bench-mlib.c | 18 ++++---- bench/bench-qt.cpp | 14 +++--- bench/bench-stl.cpp | 18 ++++---- 7 files changed, 89 insertions(+), 86 deletions(-) diff --git a/bench/Makefile b/bench/Makefile index b8a46433..17c07ccc 100644 --- a/bench/Makefile +++ b/bench/Makefile @@ -10,43 +10,46 @@ benchmark: bench-mlib bench-mlib-mempool bench-stl bench-klib bench-qt bench-gli bench-mlib: $(CC) $(CFLAGS) $(CPPFLAGS) bench-mlib.c -o bench-mlib.exe - @./bench-mlib.exe 1 - @./bench-mlib.exe 2 - @./bench-mlib.exe 3 - @./bench-mlib.exe 4 - @./bench-mlib.exe 5 - @./bench-mlib.exe 6 - @./bench-mlib.exe 7 + @./bench-mlib.exe 10 + @./bench-mlib.exe 20 + @./bench-mlib.exe 30 + @./bench-mlib.exe 40 + @./bench-mlib.exe 41 + @./bench-mlib.exe 42 + @./bench-mlib.exe 43 + @./bench-mlib.exe 50 bench-mlib-mempool: $(CC) $(CFLAGS) $(CPPFLAGS) bench-mlib.c -DUSE_MEMPOOL -o bench-mlib-mempool.exe - @./bench-mlib-mempool.exe 1 - @./bench-mlib-mempool.exe 2 - @./bench-mlib-mempool.exe 3 - @./bench-mlib-mempool.exe 4 - @./bench-mlib-mempool.exe 5 - @./bench-mlib-mempool.exe 6 - @./bench-mlib-mempool.exe 7 + @./bench-mlib-mempool.exe 10 + @./bench-mlib-mempool.exe 20 + @./bench-mlib-mempool.exe 30 + @./bench-mlib-mempool.exe 40 + @./bench-mlib-mempool.exe 41 + @./bench-mlib-mempool.exe 42 + @./bench-mlib-mempool.exe 43 + @./bench-mlib-mempool.exe 50 bench-stl: $(CXX) $(CFLAGS) $(CPPFLAGS) bench-stl.cpp -o bench-stl.exe - @./bench-stl.exe 1 - @./bench-stl.exe 2 - @./bench-stl.exe 3 - @./bench-stl.exe 4 - @./bench-stl.exe 5 - @./bench-stl.exe 6 - @./bench-stl.exe 7 + @./bench-stl.exe 10 + @./bench-stl.exe 20 + @./bench-stl.exe 30 + @./bench-stl.exe 40 + @./bench-stl.exe 41 + @./bench-stl.exe 42 + @./bench-stl.exe 43 + @./bench-stl.exe 50 bench-qt: $(CXX) $(CFLAGS) $(CPPFLAGS) -fPIC $$(pkg-config --libs --cflags Qt5Core) bench-qt.cpp -o bench-qt.exe - @./bench-qt.exe 1 - @./bench-qt.exe 2 - @./bench-qt.exe 3 - @./bench-qt.exe 4 - @./bench-qt.exe 5 - @./bench-qt.exe 6 - @./bench-qt.exe 7 + @./bench-qt.exe 10 + @./bench-qt.exe 20 + @./bench-qt.exe 30 + @./bench-qt.exe 40 + @./bench-qt.exe 41 + @./bench-qt.exe 42 + @./bench-qt.exe 50 # KLIB shall point to the directory where the headers are bench-klib: @@ -54,21 +57,21 @@ bench-klib: bench-klib0: $(CC) $(CFLAGS) $(CPPFLAGS) -I $${KLIB} bench-klib.c -o bench-klib.exe - @./bench-klib.exe 1 - @./bench-klib.exe 2 - @./bench-klib.exe 3 - @./bench-klib.exe 4 - @./bench-klib.exe 6 - @./bench-klib.exe 7 + @./bench-klib.exe 10 + @./bench-klib.exe 20 + @./bench-klib.exe 30 + @./bench-klib.exe 40 + @./bench-klib.exe 41 + @./bench-klib.exe 50 bench-glib: $(CC) $(CFLAGS) $(CPPFLAGS) bench-glib.c -o bench-glib.exe `pkg-config --libs --cflags glib-2.0` - @./bench-glib.exe 1 - @./bench-glib.exe 2 - @./bench-glib.exe 3 - @./bench-glib.exe 4 - @./bench-glib.exe 6 - @./bench-glib.exe 7 + @./bench-glib.exe 10 + @./bench-glib.exe 20 + @./bench-glib.exe 30 + @./bench-glib.exe 40 + @./bench-glib.exe 41 + @./bench-glib.exe 50 # LIBDYNAMIC shall point to the the directory containing the file libdynamic.pc bench-libdynamic: @@ -76,12 +79,12 @@ bench-libdynamic: bench-libdynamic0: $(CC) $(CFLAGS) $(CPPFLAGS) bench-libdynamic.c -o bench-libdynamic.exe `PKG_CONFIG_PATH="$${LIBDYNAMIC}" pkg-config --libs --cflags libdynamic` - @./bench-libdynamic.exe 1 - @./bench-libdynamic.exe 2 - @./bench-libdynamic.exe 3 - @./bench-libdynamic.exe 4 - @./bench-libdynamic.exe 6 - @./bench-libdynamic.exe 7 + @./bench-libdynamic.exe 10 + @./bench-libdynamic.exe 20 + @./bench-libdynamic.exe 30 + @./bench-libdynamic.exe 40 + @./bench-libdynamic.exe 41 + @./bench-libdynamic.exe 50 bench-plain: $(CC) $(CFLAGS) $(CPPFLAGS) bench-plain-c.c -o bench-plain-c.exe diff --git a/bench/bench-glib.c b/bench/bench-glib.c index d61ac7da..f521ff47 100644 --- a/bench/bench-glib.c +++ b/bench/bench-glib.c @@ -198,16 +198,16 @@ static void test_sort(size_t n) int main(int argc, const char *argv[]) { int n = (argc > 1) ? atoi(argv[1]) : 0; - if (n == 1) + if (n == 10) test_function("List time",10000000, test_list); - if (n == 2) + if (n == 20) test_function("Array time", 100000000, test_array); - if (n == 3) + if (n == 30) test_function("Rbtree time", 1000000, test_rbtree); - if (n == 4) + if (n == 40) test_function("Dict time", 1000000, test_dict); - if (n == 6) + if (n == 41) test_function("DictB time", 1000000, test_dict_big); - if (n == 7) + if (n == 50) test_function("Sort time", 10000000, test_sort); } diff --git a/bench/bench-klib.c b/bench/bench-klib.c index 645f5532..98e4f462 100644 --- a/bench/bench-klib.c +++ b/bench/bench-klib.c @@ -197,17 +197,17 @@ static void test_sort(size_t n) int main(int argc, const char *argv[]) { int n = (argc > 1) ? atoi(argv[1]): 0; - if (n == 1) + if (n == 10) test_function("List time",10000000, test_list); - if (n == 2) + if (n == 20) test_function("Array time", 100000000, test_array); - if (n == 3) + if (n == 30) test_function("B-tree time", 1000000, test_rbtree); - if (n == 4) + if (n == 40) test_function("Dict time", 1000000, test_dict); - if (n == 6) + if (n == 41) test_function("DictB time", 1000000, test_dict_big); - if (n == 7) + if (n == 50) test_function("Sort time", 10000000, test_sort); } diff --git a/bench/bench-libdynamic.c b/bench/bench-libdynamic.c index 20802a86..75411adb 100644 --- a/bench/bench-libdynamic.c +++ b/bench/bench-libdynamic.c @@ -152,10 +152,10 @@ test_dict_big(unsigned long n) int main(int argc, const char *argv[]) { int n = (argc > 1) ? atoi(argv[1]) : 0; - if (n == 2) + if (n == 20) test_function("Array time", 100000000, test_array); - if (n == 4) + if (n == 40) test_function("Dict time", 1000000, test_dict); - if (n == 6) + if (n == 41) test_function("Dict B time", 1000000, test_dict_big); } diff --git a/bench/bench-mlib.c b/bench/bench-mlib.c index 9823290b..73d4c7f4 100644 --- a/bench/bench-mlib.c +++ b/bench/bench-mlib.c @@ -274,21 +274,21 @@ static void test_sort(size_t n) int main(int argc, const char *argv[]) { int n = (argc > 1) ? atoi(argv[1]) : 0; - if (n == 1) + if (n == 10) test_function("List time",10000000, test_list); - if (n == 2) + if (n == 20) test_function("Array time", 100000000, test_array); - if (n == 3) + if (n == 30) test_function("Rbtree time", 1000000, test_rbtree); - if (n == 4) + if (n == 40) test_function("Dict time", 1000000, test_dict); - if (n == 5) + if (n == 42) test_function("DictOA time", 1000000, test_dict_oa); - if (n == 6) + if (n == 41) test_function("DictB time", 1000000, test_dict_big); - if (n == 7) - test_function("Sort time", 10000000, test_sort); - if (n == 8) + if (n == 43) test_function("DictS time", 1000000, test_dict_str); + if (n == 50) + test_function("Sort time", 10000000, test_sort); } diff --git a/bench/bench-qt.cpp b/bench/bench-qt.cpp index eba12196..f5cd911a 100644 --- a/bench/bench-qt.cpp +++ b/bench/bench-qt.cpp @@ -175,18 +175,18 @@ static void test_sort(size_t n) int main(int argc, const char *argv[]) { int n = (argc > 1) ? atoi(argv[1]) : 0; - if (n == 1) + if (n == 10) test_function("List time",10000000, test_list); - if (n == 2) + if (n == 20) test_function("Array time", 100000000, test_array); - if (n == 3) + if (n == 30) test_function("Rbtree time", 1000000, test_rbtree); - if (n == 4) + if (n == 40) test_function("Dict(m)time", 1000000, test_dict1); - if (n == 5) + if (n == 42) test_function("Dict(u)time", 1000000, test_dict2); - if (n == 6) + if (n == 41) test_function("DictB time", 1000000, test_dict_big); - if (n == 7) + if (n == 50) test_function("Sort time", 10000000, test_sort); } diff --git a/bench/bench-stl.cpp b/bench/bench-stl.cpp index 871c811c..ef109dec 100644 --- a/bench/bench-stl.cpp +++ b/bench/bench-stl.cpp @@ -203,20 +203,20 @@ static void test_sort(size_t n) int main(int argc, const char *argv[]) { int n = (argc > 1) ? atoi(argv[1]) : 0; - if (n == 1) + if (n == 10) test_function("List time",10000000, test_list); - if (n == 2) + if (n == 20) test_function("Array time", 100000000, test_array); - if (n == 3) + if (n == 30) test_function("Rbtree time", 1000000, test_rbtree); - if (n == 4) + if (n == 40) test_function("Dict(m)time", 1000000, test_dict1); - if (n == 5) + if (n == 42) test_function("Dict(u)time", 1000000, test_dict2); - if (n == 6) + if (n == 41) test_function("DictB time", 1000000, test_dict_big); - if (n == 7) - test_function("Sort time", 10000000, test_sort); - if (n == 8) + if (n == 43) test_function("DictS time", 1000000, test_dict_str); + if (n == 50) + test_function("Sort time", 10000000, test_sort); }