perf(storage): check dedicated column cache before decoding JSON - #7968
Open
julienduchesne wants to merge 1 commit into
Open
julienduchesne wants to merge 1 commit into
julienduchesne wants to merge 1 commit into
Conversation
julienduchesne
marked this pull request as ready for review
September 23, 2026 20:25
julienduchesne
requested review from
carles-grafana,
electron0zero,
ie-pham,
javiermolinar,
knylander-grafana,
mapno,
mattdurham,
mdisibio,
ruslan-mikhailov,
stoewer,
yvrhdn,
zalegrala and
zhxiaogg
as code owners
September 23, 2026 20:25
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.
Summary
Check the existing dedicated-column cache before parsing JSON during protobuf tenant-index reads. Repeated layouts currently enter Sonic before reaching the cache in
UnmarshalJSON; cache misses retain the existing decoder and validation.nullbehavior and the existing bounded cache.Reader.TenantIndexread, decompression and decode operation. Correct the existing protobuf benchmark fixture, which used JSON and ignored decode errors.Benchmarks
Go 1.27.1, Apple M3 Pro arm64, GOMAXPROCS=4; ten alternating before/after pairs at 300ms per case. Synthetic metadata varies IDs, timestamps and sizes, mixes active/compacted blocks, and uses ten shared layouts. In-memory object reads exclude network latency.
The 1,000-record shared case drops from 2,282.8 to 961.2 KiB/op and from 10,238 to 6,234 allocs/op. Fixed-workload CPU profiles for 5,000 complete reads total 5.17s before and 1.82s after (-64.8%). These are local benchmark gains; production backend-worker profiles attribute 1.15% of CPU and 5.10% of allocated bytes to this decoder, not the whole service.
Backend race tests, baseline/optimized compatibility tests, formatting and lint pass. The broad race suite was interrupted while live-store and WAL tests were still running; full-suite validation remains incomplete.
Ref: https://github.com/grafana/databases-sre/issues/419