瀏覽代碼

perf(history): use yyjson for hlog version-read parse (phase A)

fszontagh 2 月之前
父節點
當前提交
3c33d2424f
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      service/src/persistence/history_store.cpp

+ 2 - 1
service/src/persistence/history_store.cpp

@@ -1,6 +1,7 @@
 #include "history_store.hpp"
 
 #include "wal.hpp"  // crc32::calculate
+#include "../json_parse.hpp"
 
 #include <algorithm>
 #include <cstring>
@@ -121,7 +122,7 @@ HistoryStore::deserializeRecord(const std::vector<uint8_t>& data) {
     std::string verJson(reinterpret_cast<const char*>(&data[offset]), verLen);
 
     try {
-        DocumentVersion v = DocumentVersion::fromJson(nlohmann::json::parse(verJson));
+        DocumentVersion v = DocumentVersion::fromJson(smartbotic::db::parse_to_nlohmann(verJson));
         return std::make_pair(std::move(docId), std::move(v));
     } catch (const nlohmann::json::exception&) {
         return std::nullopt;