Skip to content

Commit a6aa036

Browse files
committed
Testing new fallback layer for simd.
1 parent 66e2221 commit a6aa036

6 files changed

Lines changed: 277 additions & 201 deletions

File tree

Benchmarks/tests.hpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#pragma once
2424

2525
#include "jsonifier.hpp"
26+
#include "simdjson.hpp"
2627
#include "glaze.hpp"
2728

2829
namespace tests {
@@ -605,7 +606,7 @@ namespace tests {
605606
return r;
606607
}
607608
};
608-
/*
609+
609610
template<pod_type test_data_type, bool minified, size_t iterations, const bnch_swt::string_literal test_name_new>
610611
struct json_test_helper<json_library::simdjson, test_type::parse_and_serialize, test_data_type, minified, iterations, test_name_new> {
611612
JSONIFIER_INLINE static auto run(const test_data_type& test_data_new) {
@@ -776,7 +777,7 @@ namespace tests {
776777
return r;
777778
}
778779
};
779-
*/
780+
780781
#if JSONIFIER_PLATFORM_MAC
781782
constexpr bnch_swt::string_literal table_header = bnch_swt::string_literal{
782783
R"(
@@ -868,7 +869,7 @@ In contrast, hash-based solutions offer a viable alternative by circumventing th
868869
results_data glaze_results{};
869870

870871
#if !defined(ASAN_ENABLED)
871-
//simdjson_results = json_test_helper<json_library::simdjson, type, test_data_type, minified, iterations, test_name>::run(json_data_new);
872+
simdjson_results = json_test_helper<json_library::simdjson, type, test_data_type, minified, iterations, test_name>::run(json_data_new);
872873
if constexpr (!std::is_same_v<test_data_type, partial_test<partial_test_struct>> && !std::is_same_v<test_data_type, twitter_partial_message>) {
873874
glaze_results = json_test_helper<json_library::glaze, type, test_data_type, minified, iterations, test_name>::run(json_data_new);
874875
json_results.results.emplace_back(glaze_results);
@@ -934,7 +935,7 @@ In contrast, hash-based solutions offer a viable alternative by circumventing th
934935
results_data simdjson_results{};
935936
results_data glaze_results{};
936937
#if !defined(ASAN_ENABLED)
937-
//simdjson_results = json_test_helper<json_library::simdjson, test_type::minify, std::string, false, iterations, test_name>::run(json_data_new);
938+
simdjson_results = json_test_helper<json_library::simdjson, test_type::minify, std::string, false, iterations, test_name>::run(json_data_new);
938939
glaze_results = json_test_helper<json_library::glaze, test_type::minify, std::string, false, iterations, test_name>::run(json_data_new);
939940
#endif
940941
jsonifier_results = json_test_helper<json_library::jsonifier, test_type::minify, std::string, false, iterations, test_name>::run(json_data_new);

CMake/JsonifierDetectArchitecture.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ math(EXPR INSTRUCTION_PRESENT512 "( ${JSONIFIER_CPU_INSTRUCTIONS_NUMERIC} & 0x40
7171
if(INSTRUCTION_PRESENT512)
7272
math(EXPR JSONIFIER_CPU_INSTRUCTIONS "${JSONIFIER_CPU_INSTRUCTIONS} | 1 << 6" OUTPUT_FORMAT DECIMAL)
7373
elseif(INSTRUCTION_PRESENT256)
74-
math(EXPR JSONIFIER_CPU_INSTRUCTIONS "${JSONIFIER_CPU_INSTRUCTIONS} | 1 << 5" OUTPUT_FORMAT DECIMAL)
74+
math(EXPR JSONIFIER_CPU_INSTRUCTIONS "${JSONIFIER_CPU_INSTRUCTIONS} | 1 << 0" OUTPUT_FORMAT DECIMAL)
7575
elseif(INSTRUCTION_PRESENT128)
7676
math(EXPR JSONIFIER_CPU_INSTRUCTIONS "${JSONIFIER_CPU_INSTRUCTIONS} | 1 << 4" OUTPUT_FORMAT DECIMAL)
7777
endif()

0 commit comments

Comments
 (0)