Skip to content

perf(signals): index duplicate prompt comparisons - #1425

Merged
wesm merged 3 commits into
kenn-io:mainfrom
naveenspark:perf/index-duplicate-prompt-comparisons
Aug 16, 2026
Merged

perf(signals): index duplicate prompt comparisons#1425
wesm merged 3 commits into
kenn-io:mainfrom
naveenspark:perf/index-duplicate-prompt-comparisons

Conversation

@naveenspark

Copy link
Copy Markdown
Contributor

Duplicate-prompt scoring rebuilt a token set for every comparison against prior substantive prompts. On long sessions, signal recomputation therefore spent most of its time repeating token hashing and garbage collection even when the prompts were distinct.

This change preserves the existing exact and fuzzy scoring semantics while indexing accepted prompts by normalized text and token frequency. Each prompt now evaluates only prior representatives that share tokens. A deterministic reference test compares the indexed implementation with the original pairwise algorithm, and a large-session benchmark is added to the existing PR performance gate. On the same 800-prompt shared-vocabulary fixture, current main takes about 1.42 s and allocates 2.14 GB per operation; this branch takes about 13–19 ms and allocates 16.9 MB.

The postings index grows with retained prompt tokens. A pathological session where most distinct prompts share most of their vocabulary can still require many candidate comparisons, but the implementation no longer rebuilds or scans complete token structures for every prompt pair. The main review point is equivalence with the existing asymmetric score, where current tokens are treated as a set and previous tokens remain a multiset.

@roborev-ci

roborev-ci Bot commented Aug 16, 2026

Copy link
Copy Markdown

roborev: Combined Review (396d883)

No issues found.


Reviewers: 2 done | Synthesis: codex | Total: 1m29s

@wesm

wesm commented Aug 16, 2026

Copy link
Copy Markdown
Member

LGTM

@wesm
wesm merged commit d95546d into kenn-io:main Aug 16, 2026
16 checks passed
wesm added a commit to salmonumbrella/agentsview that referenced this pull request Aug 16, 2026
…dy-core

* origin/main: (25 commits)
  ci: retry failed Docker image builds (kenn-io#1437)
  Speed up HTTP sync by processing only changed sessions (kenn-io#1414)
  chore: remove dead code and unused frontend exports (kenn-io#1434)
  fix(parser): populate Kimi session cwd (kenn-io#1427)
  feat(frontend): add raw and formatted tool output display (kenn-io#1424)
  feat(insights): support OpenAI-compatible endpoints (kenn-io#1430)
  fix(parser): support legacy Zed thread schemas (kenn-io#1429)
  perf(signals): index duplicate prompt comparisons (kenn-io#1425)
  fix(config): honor explicit empty agent directory arrays (kenn-io#1423)
  feat(parser): add DeepSeek Harness session support (kenn-io#1402)
  test(sync): wait for archive audit stall state (kenn-io#1422)
  chore(deps): update github actions dependencies (kenn-io#1421)
  Tombstone stored Claude sessions a complete full parse no longer emits (kenn-io#1392)
  fix(sync): report stalled syncs as unhealthy (kenn-io#1419)
  Reduce idle CPU and let users turn off unused providers (kenn-io#1374)
  fix(serve): survive dual-stack port collisions at startup (kenn-io#1406)
  fix(sync): bound startup reconciliation and expose daemon identity (kenn-io#1413)
  fix(deps): update module golang.org/x/mod to v0.40.0 [security] (kenn-io#1400)
  Persist Claude and Codex freshness digests across engine restarts (kenn-io#1393)
  fix(sync): add lifecycle logging (kenn-io#1399)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants