Skip to content

perf(backfill): cut allocations on backfill state hot paths#70

Draft
seanjnkns wants to merge 1 commit into
sjenkins/features/initial-benchmarksfrom
sjenkins/perf/backfillstate-hotpaths
Draft

perf(backfill): cut allocations on backfill state hot paths#70
seanjnkns wants to merge 1 commit into
sjenkins/features/initial-benchmarksfrom
sjenkins/perf/backfillstate-hotpaths

Conversation

@seanjnkns
Copy link
Copy Markdown
Contributor

Maintain incremental pgCounts instead of rescanning all PGs on each pgCountsByOsd call. Reuse caller buffers in computeBackfillSrcsTgts, inline the target OSD check in hasRoomForRemap, and pre-populate osd entries when building backfill state.

Benchmarks (large fixtures, benchstat vs scaffold baseline):
HasRoomForRemap ~39% faster, 10→4 allocs/op
AddReservations ~56% faster, ~45k→2k allocs/op
RemoveReservations ~40% faster, ~44k→0 allocs/op
ComputeBackfillSrcsTgts ~92% faster, 2→0 allocs/op

Maintain incremental pgCounts instead of rescanning all PGs on each
pgCountsByOsd call. Reuse caller buffers in computeBackfillSrcsTgts,
inline the target OSD check in hasRoomForRemap, and pre-populate osd
entries when building backfill state.

Benchmarks (large fixtures, benchstat vs scaffold baseline):
  HasRoomForRemap ~39% faster, 10→4 allocs/op
  AddReservations ~56% faster, ~45k→2k allocs/op
  RemoveReservations ~40% faster, ~44k→0 allocs/op
  ComputeBackfillSrcsTgts ~92% faster, 2→0 allocs/op
@seanjnkns seanjnkns marked this pull request as draft May 29, 2026 20:42
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