Simplify the json/src/benchmarks.cpp to allow more optimal code gen.
o For some unknown reason, the complexity of the benchmark platform prevented some C++ compilers from generating optimal code, properly reflective of the real performance in actual deployment. o Added the json_benchmarks_simple target, which performs the same suite of tests as json_benchmarks. o Simplified the benchmark platform, and emit an "Average" TPS (Transactions Per Second) value reflective of aggregate parse/output performance.
This commit is contained in:
parent
23440eb86e
commit
0b803d0a5f
4 changed files with 190 additions and 7 deletions
|
|
@ -1,11 +1,21 @@
|
|||
all: json_benchmarks
|
||||
./json_benchmarks
|
||||
|
||||
json_benchmarks: src/benchmarks.cpp ../src/json.hpp number_jsons
|
||||
#
|
||||
# Build/run json.hpp benchmarks, eg. CXX=g++-7 make
|
||||
#
|
||||
# The existing json_benchmarks did not allow optimization under some compilers
|
||||
#
|
||||
all: json_benchmarks json_benchmarks_simple number_jsons
|
||||
bash -c 'time ./json_benchmarks'
|
||||
bash -c 'time ./json_benchmarks_simple'
|
||||
|
||||
json_benchmarks: src/benchmarks.cpp ../src/json.hpp
|
||||
$(CXX) -std=c++11 -pthread $(CXXFLAGS) -DNDEBUG -O3 -flto -I thirdparty/benchpress -I thirdparty/cxxopts -I../src src/benchmarks.cpp $(LDFLAGS) -o $@
|
||||
|
||||
json_benchmarks_simple: src/benchmarks_simple.cpp ../src/json.hpp
|
||||
$(CXX) -std=c++11 $(CXXFLAGS) -DNDEBUG -O3 -flto -I../src $(<) $(LDFLAGS) -o $@
|
||||
|
||||
number_jsons:
|
||||
(test -e files/numbers/floats.json -a -e files/numbers/signed_ints.json -a -e files/numbers/unsigned_ints.json) || (cd files/numbers ; python generate.py)
|
||||
|
||||
clean:
|
||||
rm -f json_benchmarks files/numbers/*.json
|
||||
rm -f json_benchmarks json_benchmarks_simple files/numbers/*.json
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue