Skip to content

fix(analyze): stream spans.jsonl instead of reading it as one string - #15

Merged
psanders merged 1 commit into
mainfrom
fix/stream-spans
Nov 4, 2026
Merged

psanders merged 1 commit into
mainfrom
fix/stream-spans

Conversation

@psanders

@psanders psanders commented Nov 4, 2026

Copy link
Copy Markdown
Member

Routr's 1-hour soak (run 41878887922) aborted with Invalid string length: its spans.jsonl was 757 MB, which is past V8's 512 MB string limit.

  • AnalyzeDeps.readLines (optional) streams a file's lines. The Node implementation uses readline over a read stream. Without it, the analyzers fall back to readFile.
  • parseOtlpSpanLines parses one line at a time, so the file is never held as one string or one parsed object. parseOtlpSpans(text) still works on top of it.
  • Both the soak and capacity analyzers read spans.jsonl this way.

Verified against the real 757 MB file from that run: it analyzed in 4.7 s with 670 MB RSS (987k spans). 444 unit tests pass. Version 0.1.9.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WSt25Wd7udAq3aj47MKn5J

An hour of RoutrOne spans is 750 MB, past V8's 512 MB string limit, so the
soak analysis aborted with "Invalid string length". The analyzers now read
spans.jsonl line by line through AnalyzeDeps.readLines and parse each line on
its own.
@psanders
psanders merged commit 065e1bd into main Nov 4, 2026
2 checks passed
@psanders
psanders deleted the fix/stream-spans branch November 5, 2026 14:26
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