From: apostolos Date: Wed, 25 Aug 2021 08:09:45 +0000 (+0300) Subject: code size reduction by using function arrays and add bandwidth to output X-Git-Tag: v5.4.3+vectorscan~39 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1009391d9faf2bb1a38cf211ff9a4c8655af5604;p=thirdparty%2Fvectorscan.git code size reduction by using function arrays and add bandwidth to output --- 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< kill - noodle_benchmarks(2500000, 5000, "AaAAaaaA", 8, 1); ---> kill - γενικά όταν βάζω ένα string μεγέθους > 4 για nocase = 1 κάνει kill. - */ - 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); + } + } + + for(int i=0; i<12; i++){ + if(i==0){ + 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: "<