Adds yyjson to our internal benchmarks. (#1244)

This commit is contained in:
Daniel Lemire
2020-10-21 16:23:20 -04:00
committed by GitHub
parent 61fb4244f2
commit c592da4937
4 changed files with 21 additions and 1 deletions
+3
View File
@@ -37,3 +37,6 @@
[submodule "dependencies/boost.json"]
path = dependencies/boost.json
url = https://github.com/CPPAlliance/json.git
[submodule "dependencies/yyjson"]
path = dependencies/yyjson
url = https://github.com/ibireme/yyjson.git
+12
View File
@@ -13,6 +13,7 @@
#include "benchmark.h"
SIMDJSON_PUSH_DISABLE_ALL_WARNINGS
#include "yyjson.h"
// #define RAPIDJSON_SSE2 // bad for performance
// #define RAPIDJSON_SSE42 // bad for performance
@@ -190,6 +191,17 @@ bool bench(const char *filename, bool verbose, bool just_data,
BEST_TIME("Boost.json", execute(sv), false, , repeat, volume, !just_data);
}
{
auto execute = [&p]() -> bool {
yyjson_doc *doc = yyjson_read(p.data(), p.size(), 0);
bool is_ok = doc != nullptr;
yyjson_doc_free(doc);
return is_ok;
};
BEST_TIME("yyjson", execute(), true, , repeat, volume, !just_data);
}
#ifndef ALLPARSER
if (!just_data)
#endif
+5 -1
View File
@@ -72,8 +72,12 @@ if ((Git_FOUND) AND SIMDJSON_GIT AND (SIMDJSON_IS_UNDER_GIT))
target_compile_definitions(boostjson PUBLIC BOOST_JSON_STANDALONE)
target_include_directories(boostjson PUBLIC boost.json/include)
initialize_submodule(yyjson)
add_library(yyjson yyjson/src/yyjson.c)
target_include_directories(yyjson PUBLIC yyjson/src)
add_library(competition-core INTERFACE)
target_link_libraries(competition-core INTERFACE competition-json competition-rapidjson competition-sajson competition-cJSON competition-jsmn boostjson)
target_link_libraries(competition-core INTERFACE competition-json competition-rapidjson competition-sajson competition-cJSON competition-jsmn boostjson yyjson)
add_library(competition-all INTERFACE)
target_link_libraries(competition-all INTERFACE competition-core competition-jsoncppdist competition-json11 competition-fastjson competition-gason competition-ujson4c)
Vendored Submodule
+1
Submodule dependencies/yyjson added at aa33ec5a47