mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-06-28 16:41:01 +03:00
size output fixed
This commit is contained in:
parent
9901477bcf
commit
2e6c75c895
@ -4,6 +4,8 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
#include "nfa/shufticompile.h"
|
||||||
|
|
||||||
int main(){
|
int main(){
|
||||||
int sizes[]= { 16000, 32000, 64000, 120000, 1600000, 2000000, 2500000, 3500000, 150000000, 250000000, 350000000, 500000000};
|
int sizes[]= { 16000, 32000, 64000, 120000, 1600000, 2000000, 2500000, 3500000, 150000000, 250000000, 350000000, 500000000};
|
||||||
int loops[]= { 6000, 6000, 6000, 6000, 1000, 1000, 1000, 1000, 50, 50, 25, 25};
|
int loops[]= { 6000, 6000, 6000, 6000, 1000, 1000, 1000, 1000, 50, 50, 25, 25};
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
|
|
||||||
|
|
||||||
void shufti_benchmarks(int size, int loops, int M, bool has_match) {
|
void shufti_benchmarks(int size, int loops, int M, bool has_match) {
|
||||||
|
size_t real_size = size;
|
||||||
m128 lo, hi;
|
m128 lo, hi;
|
||||||
ue2::CharReach chars;
|
ue2::CharReach chars;
|
||||||
chars.set('a');
|
chars.set('a');
|
||||||
@ -53,7 +54,7 @@ void shufti_benchmarks(int size, int loops, int M, bool has_match) {
|
|||||||
}
|
}
|
||||||
total_sec /= M;
|
total_sec /= M;
|
||||||
bw /= M;
|
bw /= M;
|
||||||
std::cout << "\x1B[35m Case with match in random pos and size: " << size << " for " << loops <<" loops ("
|
std::cout << "\x1B[35m Case with match in random pos and size: " << real_size << " for " << loops <<" loops ("
|
||||||
<< M << " random possisions checked): \x1B[36m shuftiExec elapsetime: \x1B[0m" << (total_sec)
|
<< M << " random possisions checked): \x1B[36m shuftiExec elapsetime: \x1B[0m" << (total_sec)
|
||||||
<< " (μs) \x1B[36m bandwidth: \x1B[0m" << bw <<" (MB/μs)"<<std::endl;
|
<< " (μs) \x1B[36m bandwidth: \x1B[0m" << bw <<" (MB/μs)"<<std::endl;
|
||||||
} else {
|
} else {
|
||||||
@ -70,13 +71,14 @@ void shufti_benchmarks(int size, int loops, int M, bool has_match) {
|
|||||||
double mb_size = (double) size / 1048576;
|
double mb_size = (double) size / 1048576;
|
||||||
mb_size /= loops;
|
mb_size /= loops;
|
||||||
bw = mb_size / total_sec;
|
bw = mb_size / total_sec;
|
||||||
std::cout<<"\x1B[35m Case with no match in random pos and size: "<<size<<" for "<<loops<<" loops:"
|
std::cout<<"\x1B[35m Case with no match in random pos and size: "<<real_size<<" for "<<loops<<" loops:"
|
||||||
<<"\x1B[36m shuftiExec elapsetime: \x1B[0m"<<(total_sec)<<" (μs) \x1B[36m bandwidth: \x1B[0m"<< bw <<" (MB/μs)"<<std::endl;
|
<<"\x1B[36m shuftiExec elapsetime: \x1B[0m"<<(total_sec)<<" (μs) \x1B[36m bandwidth: \x1B[0m"<< bw <<" (MB/μs)"<<std::endl;
|
||||||
}
|
}
|
||||||
delete [] kt1;
|
delete [] kt1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void rshufti_benchmarks(int size, int loops, int M, bool has_match) {
|
void rshufti_benchmarks(int size, int loops, int M, bool has_match) {
|
||||||
|
size_t real_size = size;
|
||||||
m128 lo, hi;
|
m128 lo, hi;
|
||||||
ue2::CharReach chars;
|
ue2::CharReach chars;
|
||||||
chars.set('a');
|
chars.set('a');
|
||||||
@ -110,7 +112,7 @@ void rshufti_benchmarks(int size, int loops, int M, bool has_match) {
|
|||||||
}
|
}
|
||||||
total_sec /= M;
|
total_sec /= M;
|
||||||
bw /= M;
|
bw /= M;
|
||||||
std::cout << "\x1B[35m Case with match in random pos and size: " << size << " for " << loops<<" loops ("
|
std::cout << "\x1B[35m Case with match in random pos and size: " << real_size << " for " << loops<<" loops ("
|
||||||
<< M << " random possisions checked): \x1B[36m rshuftiExec elapsetime: \x1B[0m" << total_sec
|
<< M << " random possisions checked): \x1B[36m rshuftiExec elapsetime: \x1B[0m" << total_sec
|
||||||
<<" (μs) \x1B[36m bandwidth: \x1B[0m" << bw <<" (MB/μs)"<<std::endl;
|
<<" (μs) \x1B[36m bandwidth: \x1B[0m" << bw <<" (MB/μs)"<<std::endl;
|
||||||
} else {
|
} else {
|
||||||
@ -126,7 +128,7 @@ void rshufti_benchmarks(int size, int loops, int M, bool has_match) {
|
|||||||
size /=loops;
|
size /=loops;
|
||||||
double mb_size = (double) size / 1048576;
|
double mb_size = (double) size / 1048576;
|
||||||
bw = mb_size / total_sec;
|
bw = mb_size / total_sec;
|
||||||
std::cout<<"\x1B[35m Case with no match in random pos and size: "<< size <<" for "<< loops <<" loops:"
|
std::cout<<"\x1B[35m Case with no match in random pos and size: "<< real_size <<" for "<< loops <<" loops:"
|
||||||
<<"\x1B[36m rshuftiExec elapsetime: \x1B[0m"<< total_sec <<" (μs) \x1B[36m bandwidth: \x1B[0m"<< bw <<" (MB/μs)"<<std::endl;
|
<<"\x1B[36m rshuftiExec elapsetime: \x1B[0m"<< total_sec <<" (μs) \x1B[36m bandwidth: \x1B[0m"<< bw <<" (MB/μs)"<<std::endl;
|
||||||
}
|
}
|
||||||
delete [] kt1;
|
delete [] kt1;
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
|
|
||||||
void truffle_benchmarks(int size, int loops, int M, bool has_match) {
|
void truffle_benchmarks(int size, int loops, int M, bool has_match) {
|
||||||
|
size_t real_size = size;
|
||||||
m128 lo, hi;
|
m128 lo, hi;
|
||||||
ue2::CharReach chars;
|
ue2::CharReach chars;
|
||||||
chars.set('a');
|
chars.set('a');
|
||||||
@ -52,7 +53,7 @@ void truffle_benchmarks(int size, int loops, int M, bool has_match) {
|
|||||||
}
|
}
|
||||||
total_sec /= M;
|
total_sec /= M;
|
||||||
bw /= M;
|
bw /= M;
|
||||||
std::cout << "\x1B[35m Case with match in random pos and size: " << size << " for "<< loops <<" loops ("
|
std::cout << "\x1B[35m Case with match in random pos and size: " << real_size << " for "<< loops <<" loops ("
|
||||||
<< M <<" random possisions checked): \x1B[36m truffleExec elapsetime: \x1B[0m" << total_sec
|
<< M <<" random possisions checked): \x1B[36m truffleExec elapsetime: \x1B[0m" << total_sec
|
||||||
<< "(μs) \x1B[36m bandwidth: \x1B[0m"<< bw << "(MB/μs)" <<std::endl;
|
<< "(μs) \x1B[36m bandwidth: \x1B[0m"<< bw << "(MB/μs)" <<std::endl;
|
||||||
} else {
|
} else {
|
||||||
@ -68,7 +69,7 @@ void truffle_benchmarks(int size, int loops, int M, bool has_match) {
|
|||||||
size /= loops;
|
size /= loops;
|
||||||
double mb_size = (double) size / 1048576;
|
double mb_size = (double) size / 1048576;
|
||||||
bw = mb_size / total_sec;
|
bw = mb_size / total_sec;
|
||||||
std::cout<<"\x1B[35m Case with no match in random pos and size: "<< size <<" for "<< loops <<" loops:"
|
std::cout<<"\x1B[35m Case with no match in random pos and size: "<< real_size <<" for "<< loops <<" loops:"
|
||||||
<<"\x1B[36m truffleExec elapsetime: \x1B[0m" << total_sec << " μs \x1B[36m bandwidth: \x1B[0m"<< bw <<" (MB/μs)"<<std::endl;
|
<<"\x1B[36m truffleExec elapsetime: \x1B[0m" << total_sec << " μs \x1B[36m bandwidth: \x1B[0m"<< bw <<" (MB/μs)"<<std::endl;
|
||||||
}
|
}
|
||||||
delete [] kt1;
|
delete [] kt1;
|
||||||
@ -76,6 +77,7 @@ void truffle_benchmarks(int size, int loops, int M, bool has_match) {
|
|||||||
|
|
||||||
|
|
||||||
void rtruffle_benchmarks(int size, int loops, int M, bool has_match) {
|
void rtruffle_benchmarks(int size, int loops, int M, bool has_match) {
|
||||||
|
size_t real_size = size;
|
||||||
m128 lo, hi;
|
m128 lo, hi;
|
||||||
ue2::CharReach chars;
|
ue2::CharReach chars;
|
||||||
chars.set('a');
|
chars.set('a');
|
||||||
@ -109,7 +111,7 @@ void rtruffle_benchmarks(int size, int loops, int M, bool has_match) {
|
|||||||
}
|
}
|
||||||
total_sec /= M;
|
total_sec /= M;
|
||||||
bw /= M;
|
bw /= M;
|
||||||
std::cout<<"\x1B[35m Case with match in random pos and size: "<<size<<" for "<<loops<<" loops ("
|
std::cout<<"\x1B[35m Case with match in random pos and size: "<< real_size <<" for "<<loops<<" loops ("
|
||||||
<< M <<" random possisions checked):"<<"\x1B[36m rtruffleExec elapsetime: \x1B[0m"
|
<< M <<" random possisions checked):"<<"\x1B[36m rtruffleExec elapsetime: \x1B[0m"
|
||||||
<< total_sec <<" (μs) \x1B[36m bandwidth: \x1B[0m"<< bw <<"(ΜΒ/μs)"<<std::endl;
|
<< total_sec <<" (μs) \x1B[36m bandwidth: \x1B[0m"<< bw <<"(ΜΒ/μs)"<<std::endl;
|
||||||
} else {
|
} else {
|
||||||
@ -125,7 +127,7 @@ void rtruffle_benchmarks(int size, int loops, int M, bool has_match) {
|
|||||||
size /=loops;
|
size /=loops;
|
||||||
double mb_size = (double) size / 1048576;
|
double mb_size = (double) size / 1048576;
|
||||||
bw = mb_size / total_sec;
|
bw = mb_size / total_sec;
|
||||||
std::cout<<"\x1B[35m Case with no match in random pos and size: "<< size <<" for "<< loops <<" loops:"
|
std::cout<<"\x1B[35m Case with no match in random pos and size: "<< real_size <<" for "<< loops <<" loops:"
|
||||||
<<"\x1B[36m rtruffleExec elapsetime: \x1B[0m" << total_sec <<" (μs) \x1B[36m bandwidth: \x1B[0m"<< bw <<" (MB/μs)"<<std::endl;
|
<<"\x1B[36m rtruffleExec elapsetime: \x1B[0m" << total_sec <<" (μs) \x1B[36m bandwidth: \x1B[0m"<< bw <<" (MB/μs)"<<std::endl;
|
||||||
}
|
}
|
||||||
delete [] kt1;
|
delete [] kt1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user