From 1009391d9faf2bb1a38cf211ff9a4c8655af5604 Mon Sep 17 00:00:00 2001 From: apostolos Date: Wed, 25 Aug 2021 11:09:45 +0300 Subject: [PATCH] code size reduction by using function arrays and add bandwidth to output --- benchmarks/benchmarks.cpp | 143 ++++++++++---------------------------- benchmarks/noodle.cpp | 3 +- benchmarks/shufti.cpp | 8 +-- benchmarks/truffle.cpp | 8 +-- 4 files changed, 48 insertions(+), 114 deletions(-) diff --git a/benchmarks/benchmarks.cpp b/benchmarks/benchmarks.cpp index 8354a2d4..d2c5fa8a 100644 --- a/benchmarks/benchmarks.cpp +++ b/benchmarks/benchmarks.cpp @@ -3,117 +3,50 @@ #include #include #include +#include int main(){ - int sizes[]= { 10000, 16000, 32000, 64000, 120000, 1232896, 1600000, 2000000, 2500000, 3500000, 100000000, 150000000, 250000000, 350000000, 500000000}; - int iters[]= { 10000, 16000, 32000, 64000, 120000, 5000, 3000, 3000, 3000, 2000, 25, 25, 3, 3, 2}; - int exp_len[]= { 10000, 16000, 32000, 64000, 120000, 600000, 1000000, 1000000, 1500000, 3500000, 1000000, 10000000, 20000000, 30000000, 40000000}; + int sizes[]= { 16000, 32000, 64000, 120000, 1600000, 2000000, 2500000, 3500000, 150000000, 250000000, 350000000, 500000000}; + int iters[]= { 16000, 32000, 64000, 120000, 3000, 3000, 3000, 2000, 25, 3, 3, 2}; + int exp_len[]= { 16000, 32000, 64000, 120000, 1000000, 1000000, 1500000, 3500000, 10000000, 20000000, 30000000, 40000000}; const char charset[] = "aAaAaAaAAAaaaaAAAAaaaaAAAAAAaaaAAaaa"; - std::cout< functions[] = { shufti_benchmarks, rshufti_benchmarks, truffle_benchmarks, rtruffle_benchmarks }; + + for (int i=0; i<12; i++) { + std::cout << labels[i]; + for(int j=0; j<4; j++){ + functions[j](sizes[i],iters[i],exp_len[i],false); + functions[j](sizes[i],iters[i],exp_len[i],true); + } } - std::cout< kill - noodle_benchmarks(2500000, 5000, "AaAAaaaA", 8, 1); ---> kill - γενικά όταν βάζω ένα string μεγέθους > 4 για nocase = 1 κάνει kill. - */ - std::cout< shuftiExec_elapsed_seconds = end-start; total_sec += shuftiExec_elapsed_seconds.count(); - std::cout<<"\x1B[35m Case with no match in random pos and size: "< shuftiExec_elapsed_seconds = end-start; total_sec += shuftiExec_elapsed_seconds.count(); - std::cout<<"\x1B[35m Case with no match in random pos and size: "< shuftiExec_elapsed_seconds = end-start; total_sec += shuftiExec_elapsed_seconds.count(); - std::cout<<"\x1B[35m Case with no match in random pos and size: "< shuftiExec_elapsed_seconds = end-start; total_sec += shuftiExec_elapsed_seconds.count(); - std::cout<<"\x1B[35m Case with no match in random pos and size: "<