diff options
Diffstat (limited to '3rdparty/rapidjson/test/perftest')
-rw-r--r-- | 3rdparty/rapidjson/test/perftest/CMakeLists.txt | 9 | ||||
-rw-r--r-- | 3rdparty/rapidjson/test/perftest/perftest.h | 2 | ||||
-rw-r--r-- | 3rdparty/rapidjson/test/perftest/rapidjsontest.cpp | 19 |
3 files changed, 30 insertions, 0 deletions
diff --git a/3rdparty/rapidjson/test/perftest/CMakeLists.txt b/3rdparty/rapidjson/test/perftest/CMakeLists.txt index c88cf707451..c33aae469a3 100644 --- a/3rdparty/rapidjson/test/perftest/CMakeLists.txt +++ b/3rdparty/rapidjson/test/perftest/CMakeLists.txt @@ -10,6 +10,15 @@ target_link_libraries(perftest ${TEST_LIBRARIES}) add_dependencies(tests perftest) +find_program(CCACHE_FOUND ccache) +if(CCACHE_FOUND) + set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache) + set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache) + if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Qunused-arguments -fcolor-diagnostics") + endif() +endif(CCACHE_FOUND) + IF(NOT (CMAKE_BUILD_TYPE STREQUAL "Debug")) add_test(NAME perftest COMMAND ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/perftest diff --git a/3rdparty/rapidjson/test/perftest/perftest.h b/3rdparty/rapidjson/test/perftest/perftest.h index 029940934c7..b098e414720 100644 --- a/3rdparty/rapidjson/test/perftest/perftest.h +++ b/3rdparty/rapidjson/test/perftest/perftest.h @@ -30,6 +30,8 @@ # define RAPIDJSON_SSE2 #endif +#define RAPIDJSON_HAS_STDSTRING 1 + //////////////////////////////////////////////////////////////////////////////// // Google Test diff --git a/3rdparty/rapidjson/test/perftest/rapidjsontest.cpp b/3rdparty/rapidjson/test/perftest/rapidjsontest.cpp index 74424ac332b..675db3182a5 100644 --- a/3rdparty/rapidjson/test/perftest/rapidjsontest.cpp +++ b/3rdparty/rapidjson/test/perftest/rapidjsontest.cpp @@ -187,6 +187,25 @@ TEST_F(RapidJson, SIMD_SUFFIX(DocumentParse_MemoryPoolAllocator)) { } } +TEST_F(RapidJson, SIMD_SUFFIX(DocumentParseLength_MemoryPoolAllocator)) { + for (size_t i = 0; i < kTrialCount; i++) { + Document doc; + doc.Parse(json_, length_); + ASSERT_TRUE(doc.IsObject()); + } +} + +#if RAPIDJSON_HAS_STDSTRING +TEST_F(RapidJson, SIMD_SUFFIX(DocumentParseStdString_MemoryPoolAllocator)) { + const std::string s(json_, length_); + for (size_t i = 0; i < kTrialCount; i++) { + Document doc; + doc.Parse(s); + ASSERT_TRUE(doc.IsObject()); + } +} +#endif + TEST_F(RapidJson, SIMD_SUFFIX(DocumentParseIterative_MemoryPoolAllocator)) { for (size_t i = 0; i < kTrialCount; i++) { Document doc; |