Skip to content

Commit 29e13c1

Browse files
committed
Refactored and enabled to build benchmark_rapidjson
1 parent b2a315c commit 29e13c1

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

Jamroot

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,5 @@ project json_benchmark
3131

3232
# Declare executable targets of benchmarking programs
3333
exe benchmark_spirit : benchmark_spirit.cpp /json_spirit//json ;
34+
exe benchmark_rapidjson : benchmark_rapidjson.cpp ;
3435

benchmark_rapidjson.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,11 @@
1111
#include <rapidjson/filestream.h>
1212
#include <rapidjson/prettywriter.h>
1313
namespace rj = rapidjson;
14-
namespace jb = jsonbench;
1514
int main()
1615
{
1716
try
1817
{
19-
//auto const jsons = jb::get_one_json_per_line();
20-
auto const jsons = jb::get_json();
21-
auto const marks = jb::benchmark(jsons, [](std::string const& s) {
18+
jsonbench::run_benchmark("rapidjson", [](std::string const& s) {
2219
rj::Document d;
2320
d.Parse<0>(s.c_str());
2421
#ifdef JSON_BENCHMARK_DUMP_PARSED_JSON
@@ -29,7 +26,6 @@ int main()
2926
return !d.IsNull();
3027
});
3128

32-
jb::print_result(std::cout << "rapidjson: ", marks);
3329
return EXIT_SUCCESS;
3430
}
3531
catch (std::exception const& e)

0 commit comments

Comments
 (0)