mirror of
https://github.com/Tencent/WeKnora.git
synced 2026-11-03 14:33:31 +08:00
ParseLLMJsonResponse recompiled its ```json fence-extraction regexp on every call that fell through the direct-unmarshal fast path — i.e. every fenced LLM response on the graph-extraction path. Hoist it to a package-level var. Adds a test (none existed) covering direct, fenced, no-lang and prose-wrapped inputs, plus a benchmark. Benchmark, fenced payload (-benchmem): before: 3205 ns/op, 5712 B/op, 54 allocs/op after: 1315 ns/op, 693 B/op, 15 allocs/op Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>