Skip to content

perf: ingestion work and preview cloning - #1122

Merged
alexpasmantier merged 2 commits into
mainfrom
apasmantier/-/ingestion-preview-perf
Jul 24, 2026
Merged

perf: ingestion work and preview cloning#1122
alexpasmantier merged 2 commits into
mainfrom
apasmantier/-/ingestion-preview-perf

Conversation

@alexpasmantier

Copy link
Copy Markdown
Owner

No description provided.

The reader loop paid per-line costs (an async read_until, a buffer clone
and an Instant::now) which dominated ingestion time on large sources.
Read the pipe in large chunks instead and ship complete entries to the
blocking tasks, which now also split the lines.

Loading 3.5M lines end-to-end goes from ~0.76s to ~0.23s.
Generating a preview deep-copied the parsed Text twice when caching (once
for the preview, once for the cache) and every cache hit copied it again;
arriving previews were also compared structurally against the current one.
Share the text behind an Arc instead: the cache stores and returns Arc
clones, and a pointer check now short-circuits the content comparison.

Bouncing between two cached ~200k-line previews drops from ~130ms of CPU
per selection change to ~10ms.
@alexpasmantier
alexpasmantier merged commit 3e74ba4 into main Jul 24, 2026
5 checks passed
@alexpasmantier
alexpasmantier deleted the apasmantier/-/ingestion-preview-perf branch July 24, 2026 22:03
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.

1 participant