Skip to content

Commit

Permalink
adding rapidjson
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenberry committed Oct 13, 2022
1 parent 69c8161 commit 6bee5da
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
12 changes: 11 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@ CPMAddPackage(
GIT_TAG main
)

FetchContent_Declare(
rapidjson
GIT_REPOSITORY https://github.com/Tencent/rapidjson.git
GIT_TAG master
)
FetchContent_GetProperties(rapidjson)
if(NOT rapidjson_POPULATED)
FetchContent_Populate(rapidjson)
endif()

FetchContent_Declare(
daw_json_link
GIT_REPOSITORY https://github.com/beached/daw_json_link
Expand All @@ -32,7 +42,7 @@ FetchContent_MakeAvailable(daw_json_link)

add_library(${PROJECT_NAME} INTERFACE)

target_include_directories(${PROJECT_NAME} INTERFACE include ${json_SOURCE_DIR}/include)
target_include_directories(${PROJECT_NAME} INTERFACE include ${rapidjson_SOURCE_DIR}/include)

target_link_libraries(${PROJECT_NAME} INTERFACE nlohmann_json::nlohmann_json glaze daw::daw-json-link)

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# json_performance
Performance profiling of JSON libraries

Latest results:
Latest results (October, 13, 2022):

> 1,000,000 read and write passes on a single core (MacBook Pro M1)
Expand Down
6 changes: 6 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,12 @@ void nlohmann_test()
std::cout << "daw_json_link runtime: " << runtime << '\n';
}

#include "rapidjson/document.h"
#include "rapidjson/writer.h"
#include "rapidjson/stringbuffer.h"



int main()
{
glaze_test();
Expand Down

0 comments on commit 6bee5da

Please sign in to comment.