Commit Graph
3 Commits
Author SHA1 Message Date
Chris Lu ee54fd6c08 perf(weed/storage/super_block): intern the byte-encoded replica placements (#10610)
NewReplicaPlacementFromByte formatted the byte with fmt.Sprintf and parsed the
result back, allocating a string and a ReplicaPlacement every call. The master
calls it once per volume in every heartbeat, and keeps the pointer for the
lifetime of the volume, so a cluster with 1.6M volume replicas carries 1.6M of
these where a handful of distinct values exist.

The table is a flat pointer-free array, so it costs 6KB of static data and no
heap objects however few placements a cluster actually uses.

A byte only ever decodes to a valid placement, so the table is complete and the
error return stays nil.

BenchmarkSyncDataNodeRegistration/100000Volumes  500601 allocs/op -> 300589 allocs/op
2026-08-07 00:53:02 -07:00
Lisandro Pin 7913681297 ec.encode: Display a warning on EC balancing if no replica placement settings are found. (#6487) 2025-01-29 08:50:19 -08:00
Chris Lu 09ca936c78 shell: add ec.decode command 2019-12-23 12:48:20 -08:00