2017-10-04 17:27:35 +00:00
|
|
|
|
2017-10-07 22:50:19 +00:00
|
|
|
#
|
|
|
|
# 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
|
2017-10-04 17:27:35 +00:00
|
|
|
$(CXX) -std=c++11 -pthread $(CXXFLAGS) -DNDEBUG -O3 -flto -I thirdparty/benchpress -I thirdparty/cxxopts -I../src src/benchmarks.cpp $(LDFLAGS) -o $@
|
|
|
|
|
2017-10-07 22:50:19 +00:00
|
|
|
json_benchmarks_simple: src/benchmarks_simple.cpp ../src/json.hpp
|
|
|
|
$(CXX) -std=c++11 $(CXXFLAGS) -DNDEBUG -O3 -flto -I../src $(<) $(LDFLAGS) -o $@
|
|
|
|
|
2017-10-04 17:27:35 +00:00
|
|
|
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:
|
2017-10-07 22:50:19 +00:00
|
|
|
rm -f json_benchmarks json_benchmarks_simple files/numbers/*.json
|