Skip to content

perf(ceph): cut allocations on parsing and ceph JSON hot paths#72

Draft
seanjnkns wants to merge 1 commit into
sjenkins/perf/mappingstate-hotpathsfrom
sjenkins/perf/ceph-hotpaths
Draft

perf(ceph): cut allocations on parsing and ceph JSON hot paths#72
seanjnkns wants to merge 1 commit into
sjenkins/perf/mappingstate-hotpathsfrom
sjenkins/perf/ceph-hotpaths

Conversation

@seanjnkns
Copy link
Copy Markdown
Contributor

Cache erasure-coded pool flags and pg upmap items keyed off osd dump. Parse PG IDs and crushdiff lines without per-call regex or strings.Fields storms. Guard handleCephInf so bytes.Replace runs only when input contains "inf".

Benchmarks (large fixtures, benchstat vs scaffold baseline):
ImportMappingsLoop ~280x faster, 27.4 GiB→31.3 MiB B/op, 3.97M→617k allocs/op
ExportMappings ~300x faster, 27.4 GiB→31.6 MiB B/op, 3.95M→615k allocs/op
ParseCrushDiff ~59% faster, 29.2→16.5 MiB B/op, 263k→197k allocs/op
MustGetCurrentMappingState ~29% faster, 52.7→29.4 MiB B/op, 833k→593k allocs/op

Cache erasure-coded pool flags and pg upmap items keyed off osd dump.
Parse PG IDs and crushdiff lines without per-call regex or strings.Fields
storms. Guard handleCephInf so bytes.Replace runs only when input contains
"inf".

Benchmarks (large fixtures, benchstat vs scaffold baseline):
  ImportMappingsLoop ~280x faster, 27.4 GiB→31.3 MiB B/op, 3.97M→617k allocs/op
  ExportMappings ~300x faster, 27.4 GiB→31.6 MiB B/op, 3.95M→615k allocs/op
  ParseCrushDiff ~59% faster, 29.2→16.5 MiB B/op, 263k→197k allocs/op
  MustGetCurrentMappingState ~29% faster, 52.7→29.4 MiB B/op, 833k→593k allocs/op
@seanjnkns seanjnkns marked this pull request as draft May 29, 2026 22:05
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