Skip to content

Commit 0a2bca3

Browse files
authored
Merge pull request simdjson#1101 from simdjson/jkeiser/yakety-sax
Basic SAX interface with benchmarks
2 parents 1ec710c + b2779c3 commit 0a2bca3

20 files changed

+1902
-581
lines changed

benchmark/CMakeLists.txt

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
include_directories( . linux )
2-
link_libraries(simdjson simdjson-flags simdjson-windows-headers test-data)
2+
link_libraries(simdjson-windows-headers test-data)
3+
4+
5+
if (TARGET benchmark::benchmark)
6+
add_executable(bench_sax bench_sax.cpp)
7+
target_link_libraries(bench_sax simdjson-internal-flags simdjson-include-source benchmark::benchmark)
8+
endif (TARGET benchmark::benchmark)
9+
10+
link_libraries(simdjson simdjson-flags)
311
add_executable(benchfeatures benchfeatures.cpp)
412
add_executable(get_corpus_benchmark get_corpus_benchmark.cpp)
513
add_executable(perfdiff perfdiff.cpp)
@@ -14,12 +22,6 @@ target_compile_definitions(parse_nonumberparsing PRIVATE SIMDJSON_SKIPNUMBERPARS
1422
add_executable(parse_nostringparsing parse.cpp)
1523
target_compile_definitions(parse_nostringparsing PRIVATE SIMDJSON_SKIPSTRINGPARSING)
1624

17-
if (TARGET benchmark::benchmark)
18-
link_libraries(benchmark::benchmark)
19-
add_executable(bench_parse_call bench_parse_call.cpp)
20-
add_executable(bench_dom_api bench_dom_api.cpp)
21-
endif()
22-
2325
if (TARGET competition-all)
2426
add_executable(distinctuseridcompetition distinctuseridcompetition.cpp)
2527
target_link_libraries(distinctuseridcompetition competition-core)
@@ -34,4 +36,10 @@ if (TARGET competition-all)
3436
target_compile_definitions(allparsingcompetition PRIVATE ALLPARSER)
3537
endif()
3638

39+
if (TARGET benchmark::benchmark)
40+
link_libraries(benchmark::benchmark)
41+
add_executable(bench_parse_call bench_parse_call.cpp)
42+
add_executable(bench_dom_api bench_dom_api.cpp)
43+
endif()
44+
3745
include(checkperf.cmake)

benchmark/bench_dom_api.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ static void recover_one_string(State& state) {
2222
return;
2323
}
2424
dom::element doc;
25-
if (error = parser.parse(docdata).get(doc)) {
25+
if ((error = parser.parse(docdata).get(doc))) {
2626
cerr << "could not parse string" << error << endl;
2727
return;
2828
}
@@ -48,8 +48,7 @@ static void serialize_twitter(State& state) {
4848
return;
4949
}
5050
// we do not want mem. alloc. in the loop.
51-
error = parser.allocate(docdata.size());
52-
if(error) {
51+
if((error = parser.allocate(docdata.size()))) {
5352
cout << error << endl;
5453
return;
5554
}

0 commit comments

Comments
 (0)