memgraph/tests/manual/query_stripper_timing.cpp
florijan 971e006d13 Query stripping now uses a parse tree and differentiates between int literals in a range expression (not stripped) and outside of a range (stripped).
Summary: See above

Reviewers: buda, mislav.bradac

Reviewed By: mislav.bradac

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D98
2017-03-08 14:19:55 +01:00

29 lines
658 B
C++

//
// Copyright 2017 Memgraph
// Created by Florijan Stamenkovic on 07.03.17.
//
#include <ctime>
#include <iostream>
#include "query/stripper.hpp"
int main(int argc, const char **a) {
if (argc < 2) {
std::cout << "Provide a query string as input" << std::endl;
return 1;
}
const char *query = a[1];
const int REPEATS = 100;
clock_t begin = clock();
for (int i = 0; i < REPEATS; ++i)
query::Strip(query);
clock_t end = clock();
double elapsed_secs = double(end - begin) / CLOCKS_PER_SEC;
std::cout << "Performed " << REPEATS << " strip ops, each took "
<< elapsed_secs / REPEATS * 1000 << "ms" << std::endl;
}