Repository navigation
Conversation
Red: readPackets allocates about 2390 bytes per packet with one observation on the fixture (limit 2000). The equivalence test compares it with a copy of itself as it stands, odd JSON included. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KaR4xu8gVykQBkH8yG8m6H
readPackets reads every packet of the window with every observation. It scanned each observation's resolved_path (~420 chars on live data) and path into strings, copied them into []byte for the decoder, decoded the resolved path into a pointer per hop and copied it again, and declared its scan targets per row. The JSON columns are now scanned as sql.RawBytes and read from the driver's buffer. Arrays of escape-free strings and nulls (all of them on live data) are read in place, with each distinct hop or key held once per read; anything else is decoded as before. decoded_json is selected only for the payload types that use it, and the scan targets are declared once. The output is identical (pinned against the previous code, odd JSON included). On a copy of a busy week: allocated by one fill 862MB -> 581MB, fill time 4.07s -> 2.62s, server CPU over the run 86.6s -> 79.1s. Fixture: 2390 -> 1735 bytes per packet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KaR4xu8gVykQBkH8yG8m6H
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KaR4xu8gVykQBkH8yG8m6H
A13xB0
added a commit
that referenced
this pull request
Oct 14, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KaR4xu8gVykQBkH8yG8m6H
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.
Problem
The Data tab fill (
readPackets) reads every packet of the window with every observation. For each observation it:resolved_pathand thepathinto strings;[]bytefor the decoder;A fill landing on top of the store's startup load is what set off the pre-prod OOM kills (see #16).
Change
sql.RawBytesand read straight from the driver's buffer.decoded_jsonis selected only for the payload types that use it (4, 5, 6).Measured
Tests
TestDataReadPacketsAllocationsPerObservation(limit 2000): red commit first, then green.TestDataReadPacketsMatchesReferencecompares against the previousreadPacketson the Data fixture plus edge rows: null hops,[], invalid JSON, non-string elements, escapes.go test ./cmd/serverpasses.No config or UI changes.
🤖 Generated with Claude Code
https://claude.ai/code/session_01KaR4xu8gVykQBkH8yG8m6H