You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
perf: reduce query latency regression from 3.1.4 to 3.3.0 (#528)
* perf: reduce query latency regression from 3.1.4 → 3.3.0
Three targeted fixes for the +28–56% query latency regression:
1. Pin benchmark hub target to stable function names (buildGraph,
openDb, loadConfig) instead of auto-selecting the most-connected
node. Barrel/type files becoming the hub made version-to-version
comparison meaningless.
2. Gate implementors queries in bfsTransitiveCallers — check once
whether the graph has any 'implements' edges before doing per-node
findNodeById + findImplementors lookups. Skips all implementor
overhead for codebases without interface/trait hierarchies.
3. Cache loadConfig() results per cwd. The config file is read from
disk on every fnImpactData and diffImpactData call; caching
eliminates redundant fs.existsSync + readFileSync + JSON.parse
per query invocation.
Impact: 5 functions changed, 123 affected
* fix: return structuredClone from config cache and guard benchmark db handle
Prevent callers from mutating the cached config object by returning a
deep clone on cache hits. Add try/finally to selectTargets() so the
database handle is closed even if a query throws.
Impact: 2 functions changed, 1 affected
* fix: install @huggingface/transformers in npm-mode benchmark workers
The embedding benchmark's npm mode installs codegraph into a temp dir,
but @huggingface/transformers is a devDependency and not included.
All 6 model workers crash on import, producing symbols: 0, models: {}.
Install it explicitly from the local devDependencies version, matching
the existing pattern for native platform packages. Also add a guard in
update-embedding-report.js to reject empty results and fail loudly
instead of silently overwriting valid benchmark data.
* fix: clone config on cache-miss paths to prevent cache corruption (#528)
Impact: 1 functions changed, 118 affected
0 commit comments