Skip to content

perf: speed bounded projections and correct click timing#61

Merged
wolfiesch merged 8 commits into
mainfrom
codex/transcript-click-profile
Jul 19, 2026
Merged

perf: speed bounded projections and correct click timing#61
wolfiesch merged 8 commits into
mainfrom
codex/transcript-click-profile

Conversation

@wolfiesch

Copy link
Copy Markdown
Collaborator

Outcome

Speeds the fixed 10,000-entry plus 100,000-event projection workload while preserving retention, ordering, cursor, and immutability contracts. It also separates Playwright action delivery from the real DOM click so browser reports measure application work directly.

Evidence

  • Conservative identical-tree projection result: 50,455 ns/event versus 63,356 ns/event baseline, 20.4% faster.
  • Event heap growth: 2.3 MB versus 9.3 MB baseline, 75% lower.
  • Ten-run VPS browser median, real DOM click to visible transcript: 154.8 ms to 126.7 ms, 18.2% faster.
  • Real click to tail paint median: 424.4 ms to 412.1 ms, 2.9% faster.
  • Downstream browser p95 remains noisy; this PR does not claim a tail-paint p95 improvement.

Verification

  • pnpm check
  • 53 focused retention, projection, and fixed core benchmark tests
  • 102 desktop tests after checksum-verified Electron repair
  • 10-run matched browser baseline and candidate sets on the same VPS
  • final clean browser benchmark smoke

The VPS has a real /usr/local/bin/omp, so three pre-existing desktop discovery assertions that assume the fallback path is absent are left to clean CI. All changed client tests and the remaining desktop suite passed.

Benchmark entrypoint: bash autoresearch.sh
Goal: Reduce projection event processing cost for the fixed 10,000-entry snapshot plus 100,000-event workload without changing protocol, ordering, cursor, history, or bounded-retention semantics.
… improvement, pending required identical-tree confirmation.

Result: {"status":"keep","projection_event_ns_per_event":51616.94091,"projection_event_p95_ns_per_event":60812.81317000001,"projection_events_ms":5161.694091,"projection_snapshot_ms":84.44190400000002,"projection_event_heap_growth_bytes":42670976}
…rsus the segment baseline and 5.8% versus the prior best, pending identical-tree confirmation.

Result: {"status":"keep","projection_event_ns_per_event":48600.09677999999,"projection_event_p95_ns_per_event":51156.74766999997,"projection_events_ms":4860.009677999999,"projection_snapshot_ms":76.79977500000018,"projection_event_heap_growth_bytes":2316392}
Copilot AI review requested due to automatic review settings July 19, 2026 03:41

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8ec4655955

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread autoresearch.sh Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Improves performance observability and throughput for bounded transcript projections by tightening projection updates, reducing retention/serialization overhead, and refining browser benchmark timing boundaries to separate Playwright automation cost from application click-to-render work.

Changes:

  • Optimizes projection snapshot updates (LRU/touch + arrival ordinal handling) to reduce per-event overhead.
  • Speeds retained transcript byte accounting and key ordering; adds tests to pin JSON-byte semantics and prioritization behavior.
  • Extends perf tooling (warmups, ns/event metric, autoresearch output, and new browser click timing phases) with updated docs.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
scripts/perf/ui.mjs Adds new browser phase metrics separating Playwright delivery time from real DOM click timing.
scripts/perf/core.test.ts Adds warmups and a normalized ns/event metric; strengthens projection semantics assertions during perf runs.
scripts/perf/autoresearch-report.mjs New script to emit standardized metrics + evidence metadata for autoresearch ingestion.
packages/client/test/transcript-retention.test.ts Adds coverage for retained JSON byte counting and key prioritization under tight budgets.
packages/client/src/transcript-retention.ts Optimizes byte accounting (fast paths, cached encoder) and reduces unnecessary key sorting / ancestor copying.
packages/client/src/projection.ts Adds LRU touch fast-path and moves arrivalOrdinal updates into withSession for fewer allocations.
e2e/remote-app.spec.ts Captures real DOM click timestamp to support new UI perf phase boundaries.
docs/PERFORMANCE.md Documents the split between Playwright-delivery-inclusive vs DOM-click-origin metrics.
autoresearch.sh New runner script to generate perf artifacts and autoresearch-friendly output.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/client/src/transcript-retention.ts Outdated
Comment thread docs/PERFORMANCE.md Outdated
@wolfiesch
wolfiesch merged commit 198fc32 into main Jul 19, 2026
4 checks passed
@wolfiesch
wolfiesch deleted the codex/transcript-click-profile branch July 19, 2026 03:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants