fix benchmarks outputs

This commit is contained in:
apostolos
2021-09-14 15:32:26 +03:00
committed by Konstantinos Margaritis
parent d39e132fdf
commit 8ae4fab6c6
5 changed files with 230 additions and 224 deletions

View File

@@ -4,40 +4,25 @@
#include <string.h>
#include <time.h>
#include <functional>
#include <vector>
#define MAX_LOOPS 500000000
#define MAX_MATCHES 10
int main(){
int sizes[]= { 16000, 32000, 64000, 120000, 1600000, 2000000, 2500000, 3500000, 150000000, 250000000, 350000000, 500000000};
int f_loops[]= { 70000, 50000, 30000, 10000, 1000, 1000, 1000, 1000, 7, 7, 5, 3};
int t_loops[]= { 200000, 150000, 100000, 70000, 5000, 5000, 5000, 5000, 50, 50, 50, 50};
int exp_len[]= { 15, 15, 15, 15, 5, 5, 5, 5, 5, 5, 5, 5};
int nd_loops[]= { 250000, 150000, 100000, 100000, 10000, 1000, 1000, 1000, 100, 100, 100, 100};
const char charset[] = "aAaAaAaAAAaaaaAAAAaaaaAAAAAAaaaAAaaa";
std::string labels[] = {"\x1B[33m Benchmarks(kbytes) \x1B[0m\n", "\x1B[33m Benchmarks(kbytes) \x1B[0m\n",
"\x1B[33m Benchmarks(kbytes) \x1B[0m\n", "\x1B[33m Benchmarks(kbytes) \x1B[0m\n",
"\x1B[33m Benchmarks(Mbytes) \x1B[0m\n", "\x1B[33m Benchmarks(Mbytes) \x1B[0m\n",
"\x1B[33m Benchmarks(Mbytes) \x1B[0m\n", "\x1B[33m Benchmarks(Mbytes) \x1B[0m\n",
"\x1B[33m Benchmarks(Gbytes) \x1B[0m\n", "\x1B[33m Benchmarks(Gbytes) \x1B[0m\n",
"\x1B[33m Benchmarks(Gbytes) \x1B[0m\n", "\x1B[33m Benchmarks(Gbytes) \x1B[0m\n"
};
std::function<void(int,int,int,bool)> functions[] = { shufti_benchmarks, rshufti_benchmarks, truffle_benchmarks, rtruffle_benchmarks };
for (int i=11; i<12; i++) {
std::cout << labels[i];
for(int j=0; j<4; j++){
functions[j](sizes[i],f_loops[i],exp_len[i],false);
functions[j](sizes[i],t_loops[i],exp_len[i],true);
int sizes[] = { 16000, 32000, 64000, 120000, 1600000, 2000000, 2500000, 3500000, 150000000, 250000000, 350000000, 500000000 };
const char charset[] = "aAaAaAaAAAaaaaAAAAaaaaAAAAAAaaaAAaaa";
/*
for (size_t i = 0; i < std::size(sizes); i++) {
for(int j = 0; j < 4; j++) {
functions[j](sizes[i], MAX_LOOPS / sizes[i], MAX_MATCHES, false);
functions[j](sizes[i], MAX_LOOPS / sizes[i], MAX_MATCHES, true);
}
}
for(int i=0; i<12; i++){
if(i==0){
std::cout<<std::endl <<"\x1B[33m noodle Benchmarks(kbytes) \x1B[0m"<<std::endl;
}else if (i==4)
{
std::cout<<std::endl <<"\x1B[33m noodle Benchmarks(Mbytes) \x1B[0m"<<std::endl;
}else if (i==8)
{
std::cout<<std::endl <<"\x1B[33m noodle Benchmarks(Gbytes) \x1B[0m"<<std::endl;
}
*/
for(size_t i=0; i < std::size(sizes); i++){
//we imitate the noodle unit tests
for (int char_len = 1; char_len < 9; char_len++) {
char *str = new char[char_len];
for (int j=0; j<char_len; j++) {
@@ -46,7 +31,7 @@ int main(){
str[char_len] = charset[key];
str[char_len + 1] = '\0';
}
noodle_benchmarks(sizes[i], nd_loops[i], str,char_len,0);
noodle_benchmarks(sizes[i], MAX_LOOPS / sizes[i], str,char_len, 0);
delete [] str;
}
}