perf: use JSON.parse instead of JSON5.parse for sessions.json (~35x faster) (#14530)

Co-authored-by: hyf0-agent <hyf0-agent@users.noreply.github.com>
This commit is contained in:
hyf0-agent 2026-02-12 16:10:21 +08:00 committed by GitHub
parent 16f2492547
commit 5c32989f53
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,4 +1,3 @@
import JSON5 from "json5";
import crypto from "node:crypto";
import fs from "node:fs";
import path from "node:path";
@ -144,7 +143,7 @@ export function loadSessionStore(
let mtimeMs = getFileMtimeMs(storePath);
try {
const raw = fs.readFileSync(storePath, "utf-8");
const parsed = JSON5.parse(raw);
const parsed = JSON.parse(raw);
if (isSessionStoreRecord(parsed)) {
store = parsed;
}