mirror of
https://github.com/nlohmann/json
synced 2024-11-22 12:00:05 +00:00
towards a benchmark
This commit is contained in:
parent
bbc0f64fa5
commit
5dbdba3c43
3
.gitignore
vendored
3
.gitignore
vendored
@ -2,3 +2,6 @@
|
|||||||
src/.DS_Store
|
src/.DS_Store
|
||||||
|
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
|
||||||
|
benchmark/auctions.json
|
||||||
|
benchmark/citylots.json
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
noinst_PROGRAMS = json json98
|
noinst_PROGRAMS = json json98 json98benchmark
|
||||||
TESTS = ./json ./json98
|
TESTS = ./json ./json98
|
||||||
|
|
||||||
json_SOURCES = src/JSON.cc src/JSON.h test/JSON_test.cc
|
json_SOURCES = src/JSON.cc src/JSON.h test/JSON_test.cc
|
||||||
@ -9,6 +9,10 @@ json98_SOURCES = src/JSON.cc src/JSON.h test/JSON_test.cc
|
|||||||
json98_CXXFLAGS = -std=c++98
|
json98_CXXFLAGS = -std=c++98
|
||||||
json98_CPPFLAGS = -I$(top_srcdir)/src
|
json98_CPPFLAGS = -I$(top_srcdir)/src
|
||||||
|
|
||||||
|
json98benchmark_SOURCES = src/JSON.cc src/JSON.h benchmark/JSON_benchmark.cc
|
||||||
|
json98benchmark_CXXFLAGS = -std=c++98 -O3
|
||||||
|
json98benchmark_CPPFLAGS = -I$(top_srcdir)/src -DNDEBUG
|
||||||
|
|
||||||
svn-clean: maintainer-clean
|
svn-clean: maintainer-clean
|
||||||
rm -fr configure INSTALL aclocal.m4 build-aux depcomp install-sh missing test-driver cover_html *.gcda *.gcno coverage*.info
|
rm -fr configure INSTALL aclocal.m4 build-aux depcomp install-sh missing test-driver cover_html *.gcda *.gcno coverage*.info
|
||||||
for DIR in $(DIST_SUBDIRS) .; do rm -f $$DIR/Makefile.in; done
|
for DIR in $(DIST_SUBDIRS) .; do rm -f $$DIR/Makefile.in; done
|
||||||
|
14
benchmark/JSON_benchmark.cc
Normal file
14
benchmark/JSON_benchmark.cc
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
#include <iostream>
|
||||||
|
#include <fstream>
|
||||||
|
#include <JSON.h>
|
||||||
|
|
||||||
|
int main(int argc, char** argv) {
|
||||||
|
JSON json;
|
||||||
|
std::ifstream infile(argv[1]);
|
||||||
|
|
||||||
|
json << infile;
|
||||||
|
|
||||||
|
std::cout << json.size() << "\n";
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
7
benchmark/download.sh
Executable file
7
benchmark/download.sh
Executable file
@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
git clone https://github.com/zeMirco/sf-city-lots-json.git
|
||||||
|
mv sf-city-lots-json/citylots.json .
|
||||||
|
rm -fr sf-city-lots-json
|
||||||
|
|
||||||
|
wget http://eu.battle.net/auction-data/258993a3c6b974ef3e6f22ea6f822720/auctions.json
|
Loading…
Reference in New Issue
Block a user