memgraph/tests/manual/stripped_timing.cpp
Mislav Bradac 67b859cf13 Add AST cache
Reviewers: buda, teon.banek, florijan

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D468
2017-06-14 18:59:31 +02:00

30 lines
694 B
C++

//
// Copyright 2017 Memgraph
// Created by Florijan Stamenkovic on 07.03.17.
//
#include <ctime>
#include <iostream>
#include "query/frontend/stripped.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::StrippedQuery(std::string(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;
}