Skip to content

perf(main): serialize remap updates and trim calc hot-path allocs#73

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

perf(main): serialize remap updates and trim calc hot-path allocs#73
seanjnkns wants to merge 1 commit into
sjenkins/perf/ceph-hotpathsfrom
sjenkins/perf/main-hotpaths

Conversation

@seanjnkns
Copy link
Copy Markdown
Contributor

Apply tryRemap from a single goroutine in calcPgMappingsToUndoBackfill to avoid concurrent mapping state lock contention. Cache crush tree lookups in getCandidateMappings and reduce per-iteration string parsing and slicing.

Benchmarks (large fixtures, benchstat vs scaffold baseline):
CalcPgMappingsToUndoBackfill ~35% faster, 62.8→32.6 MiB B/op, 1.05M→636k allocs/op
CalcPgMappingsToDrainOsd ~73% faster, 81.1→42.8 MiB B/op, 1.21M→606k allocs/op
CalcPgMappingsToBalanceOsds ~21% faster, 52.7→29.4 MiB B/op, 834k→593k allocs/op
GenerateCrushChangeMappings ~68% faster, 31.7→19.0 MiB B/op, 263k→197k allocs/op

Apply tryRemap from a single goroutine in calcPgMappingsToUndoBackfill to
avoid concurrent mapping state lock contention. Cache crush tree lookups in
getCandidateMappings and reduce per-iteration string parsing and slicing.

Benchmarks (large fixtures, benchstat vs scaffold baseline):
  CalcPgMappingsToUndoBackfill ~35% faster, 62.8→32.6 MiB B/op, 1.05M→636k allocs/op
  CalcPgMappingsToDrainOsd ~73% faster, 81.1→42.8 MiB B/op, 1.21M→606k allocs/op
  CalcPgMappingsToBalanceOsds ~21% faster, 52.7→29.4 MiB B/op, 834k→593k allocs/op
  GenerateCrushChangeMappings ~68% faster, 31.7→19.0 MiB B/op, 263k→197k allocs/op
@seanjnkns seanjnkns marked this pull request as draft May 29, 2026 22:39
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