feat: 将 JSON 处理库从 json 更改为 orjson,以提高性能和兼容性

This commit is contained in:
Windpicker-owo
2025-11-06 12:47:56 +08:00
parent e29266582d
commit 17c1d4b4f9
18 changed files with 83 additions and 78 deletions

View File

@@ -4,7 +4,7 @@
直接从存储的数据文件生成可视化,无需启动完整的记忆管理器
"""
import json
import orjson
import sys
from pathlib import Path
from datetime import datetime
@@ -122,7 +122,7 @@ def load_graph_data(file_path: Optional[Path] = None) -> Dict[str, Any]:
print(f"📂 加载图数据: {graph_file}")
with open(graph_file, 'r', encoding='utf-8') as f:
data = json.load(f)
data = orjson.loads(f.read())
# 解析数据
nodes_dict = {}