Repository navigation
fix(analyze): stream spans.jsonl instead of reading it as one string - #15
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 usesreadlineover a read stream. Without it, the analyzers fall back toreadFile.parseOtlpSpanLinesparses 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.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