diff --git a/benchmark/JSON_benchmark.cc b/benchmark/JSON_benchmark.cc index 86b57bad..7cecaec6 100644 --- a/benchmark/JSON_benchmark.cc +++ b/benchmark/JSON_benchmark.cc @@ -1,14 +1,17 @@ #include #include +#include #include int main(int argc, char** argv) { + time_t timer1, timer2; + JSON json; std::ifstream infile(argv[1]); - + time(&timer1); json << infile; - - std::cout << json.size() << "\n"; + time(&timer2); + std::cout << "Parsing from std::ifstream: " << difftime(timer2, timer1) << " sec\n"; return 0; } diff --git a/benchmark/benchmark.py b/benchmark/benchmark.py new file mode 100755 index 00000000..b7d53323 --- /dev/null +++ b/benchmark/benchmark.py @@ -0,0 +1,11 @@ +#!/usr/bin/env python + +import json +import sys +import datetime + +a = datetime.datetime.now() +data = json.loads(open(sys.argv[1]).read()) +b = datetime.datetime.now() + +print (b-a) diff --git a/configure.ac b/configure.ac index 6c4c02e4..b67883ab 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,7 @@ AC_INIT([JSON], [1.0], [niels.lohmann@uni-rostock.de]) AC_CONFIG_SRCDIR([src/JSON.cc]) -AM_INIT_AUTOMAKE([foreign]) +AM_INIT_AUTOMAKE([foreign subdir-objects]) AM_SILENT_RULES([yes]) AC_PROG_CXX