25 using namespace impala;
47 for (
int i = 0; i < batch_size; ++i) {
49 for (
int n = 0; n < data->
needles.size(); ++n) {
50 char* needle = data->
needles[n].ptr;
51 for (
int iters = 0; iters < 10; ++iters) {
52 for (
int h = 0; h < data->
haystacks.size(); ++h) {
53 if (strstr(data->
haystacks[h].ptr, needle) != NULL) {
64 for (
int i = 0; i < batch_size; ++i) {
66 for (
int n = 0; n < data->
needles.size(); ++n) {
68 for (
int iters = 0; iters < 10; ++iters) {
69 for (
int h = 0; h < data->
haystacks.size(); ++h) {
81 for (
int i = 0; i < batch_size; ++i) {
83 for (
int n = 0; n < data->
needles.size(); ++n) {
86 for (
int iters = 0; iters < 10; ++iters) {
87 for (
int h = 0; h < data->
haystacks.size(); ++h) {
99 for (
int i = 0; i < batch_size; ++i) {
101 for (
int n = 0; n < data->
needles.size(); ++n) {
104 for (
int iters = 0; iters < 10; ++iters) {
105 for (
int h = 0; h < data->
haystacks.size(); ++h) {
120 vector<string> needles;
121 vector<string> haystacks;
123 needles.push_back(
"xyz");
127 haystacks.push_back(
"d1h2POju5AG3zCxiBNKBxdzLdW7VfPkgvHDRLK2o78pGu4eywZ5mmmsV1LscqIH");
128 haystacks.push_back(
"Xv7rmDx3ksECRPg94mPLI1gQjRIviZNINZwbDsvcyNAf7q4pzGQ6JHUqYHxFk0x");
129 haystacks.push_back(
"cI8f2V9cYjmE70ruUeST9Arty7B8iKLiF4DaXhY4nF7OmXZOKRBVPd5cmjxiDRw");
130 haystacks.push_back(
"3cb7QCWJ7QzNSwaXQQIByo7is1b3YPTx9u0ZmRV0IJEKJE2z2oMaKgzeA1ny7hx");
131 haystacks.push_back(
"teRFhdOc5HrGvXUo1yGZSUc46hCVLjVzGaK37vfGAsuCpiji2R4YQ7Y4FN2O3lu");
132 haystacks.push_back(
"xecRm4HYLTfhQgPQHTIhWQKNGJcAUYCziDJQlbAitVHC9ClbbcEkVrXsFSpVrx9");
133 haystacks.push_back(
"M1k4su3sxpcBl8SQgnF6LOD1fNjTrQQW84vLofF39IbY4gTVpsHIlon8mbJ74D7");
134 haystacks.push_back(
"dMROjEop61WoHNSegkiw7o1uIM5xgccf9SRhIEOnq9CoM7e0KatpjAmGLlANggK");
135 haystacks.push_back(
"OIPM3iTT40sSkCTfDOjK4BSHZvV0xazTXarwYhyQEu5aGn7XeCABezJhbO1X8rr");
136 haystacks.push_back(
"0YyLBoITUS7Mxfo3o44j4eEdWqwx6Um5EkUzIo7c0ETYfnkcaHsYcpT5Xn3coyE");
137 haystacks.push_back(
"LzOFXp8ekVkeBy6Br9rRefzDDA30SLkvV3gGochoKGUkS0oj9fANBfOSBeyNypm");
138 haystacks.push_back(
"uYDMZ4SNIh6XwBQcGCS3AQ5h5c2iyaPS70r4emPheC3hQhM84zwsMovByLNecTW");
139 haystacks.push_back(
"EFY8GtkUkXRJQr3ZjANKhUFXTmnA2S4V6hTKeeskQhlUA65lTCO0PpyZxL8kyVE");
140 haystacks.push_back(
"fgU8K01JtTn3UldvO9jAywDEN4HW5PwCFEJ4pwSwHfec6HsBN5rzzhQ2Tn4QDxE");
141 haystacks.push_back(
"TMLE6UzW3CUUogfRFjZooP1eCZn05bI6NsWL67fOmwYhZND1nuAASG0ZhGFBdZH");
144 haystacks.push_back(
"of9VxyzzWca0GBs8CrFsDIvi8yWCkRTRRL7X4TlMhPfRAWPOZfRVwybJoYQhslJ");
145 haystacks.push_back(
"iEO7zz7wWm4LmvumisOwPRUzv9xyzhI7omKDlLYM7Vao9pggACVgDJBhAzDkcJp");
146 haystacks.push_back(
"tQJzS0SiXRElwq1QEBhy0gGGii9xAcQbTIrt4QcGMViyOx4lfZ73zZ5XHxyzk1V");
147 haystacks.push_back(
"tQJzS0SiXRElwq1QEBhy0gGGii9xAcQbTIrt4QcGMViyOx4lfZ73zZ5XHyzaxyz");
149 for (
int i = 0; i < needles.size(); ++i) {
150 StringValue v(const_cast<char*>(needles[i].c_str()), needles[i].size());
152 data->
strings.push_back(needles[i]);
154 for (
int i = 0; i < haystacks.size(); ++i) {
155 StringValue v(const_cast<char*>(haystacks[i].c_str()), haystacks[i].size());
157 data->
strings.push_back(haystacks[i]);
161 int main(
int argc,
char **argv) {
int AddBenchmark(const std::string &name, BenchmarkFunction fn, void *args, int baseline_idx=0)
static std::string GetMachineInfo()
Output machine/build configuration as a string.
int Search(const StringValue *str) const
void TestImpalaNullTerminated(int batch_size, void *d)
vector< StringValue > needles
vector< StringValue > haystacks
std::string Measure()
Runs all the benchmarks and returns the result in a formatted string.
int Search(const StringValue &haystack) const
void TestImpalaNonNullTerminated(int batch_size, void *d)
void TestPython(int batch_size, void *d)
int main(int argc, char **argv)
void TestLibc(int batch_size, void *d)
static void Init()
Initialize CpuInfo.
void InitTestData(TestData *data)