Chris Lu and GitHub
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
..
2026-07-22 14:38:06 -07:00
2026-07-27 14:28:29 -07:00
2026-06-30 02:01:14 -07:00
2026-08-07 00:51:52 -07:00
2026-07-22 14:38:06 -07:00
2026-08-07 00:53:02 -07:00
2026-05-21 09:42:07 -07:00
2026-07-09 11:19:31 -07:00
2026-06-16 11:47:32 -07:00
2026-05-21 02:16:28 -07:00
2026-05-31 18:52:44 -07:00
2026-04-27 16:01:10 -07:00
2026-06-12 23:51:29 -07:00
2026-07-25 23:45:02 -07:00
2026-02-02 17:55:04 -08:00
2026-07-25 23:45:02 -07:00
2026-06-12 23:51:29 -07:00
2026-08-04 13:33:31 -07:00
2026-08-04 13:33:31 -07:00
2026-04-16 22:01:34 -07:00
2026-04-16 22:01:34 -07:00
2026-04-16 22:01:34 -07:00
2026-05-13 10:22:01 -07:00
2026-07-24 23:10:35 -07:00
2026-04-16 22:01:34 -07:00
2026-07-08 01:27:10 -07:00
2026-07-25 23:45:02 -07:00
2026-06-02 09:02:05 -07:00
2026-06-14 06:36:47 -07:00
2026-06-02 09:02:05 -07:00
2026-04-13 21:10:36 -07:00
2026-06-10 13:33:45 -07:00
2026-06-12 23:51:29 -07:00
2026-06-02 09:02:05 -07:00
2026-05-17 19:55:15 -07:00
2026-06-02 09:02:05 -07:00
2026-06-02 09:02:05 -07:00
2026-06-11 20:26:20 -07:00
2026-07-22 14:38:06 -07:00
2026-06-25 10:38:14 -07:00
2026-06-25 10:38:14 -07:00
2026-01-23 16:38:36 -08:00
2026-08-01 00:27:06 -07:00
2026-06-02 09:02:05 -07:00
2026-06-14 07:32:36 -07:00
2025-10-20 16:11:29 -07:00
2026-07-07 23:00:22 -07:00
2026-06-02 09:02:05 -07:00
2026-04-03 16:04:27 -07:00
2026-07-16 15:18:38 -07:00
2025-06-30 13:57:28 -07:00
2026-04-01 01:15:26 -07:00
2026-07-25 23:45:02 -07:00
2025-06-16 22:05:06 -07:00
2026-06-30 02:01:14 -07:00
2026-06-30 02:01:14 -07:00
2026-05-28 15:39:31 -07:00
2026-07-28 16:48:30 -07:00
2026-07-28 16:48:30 -07:00
2026-06-16 10:35:06 -07:00
2026-05-09 09:55:02 -07:00
2026-05-26 16:56:49 -07:00
2026-07-28 16:48:30 -07:00
2026-05-18 20:51:04 -07:00
2026-05-06 18:23:06 -07:00
2026-05-09 09:55:02 -07:00
2026-07-30 17:03:38 -07:00
2026-01-16 19:19:18 -08:00
2026-07-08 01:27:10 -07:00
2026-06-13 20:06:24 -07:00
2026-08-01 00:37:22 -07:00
2026-08-04 21:02:52 -07:00
2026-08-04 16:58:25 -07:00
2026-08-04 16:58:25 -07:00
2026-07-25 23:45:02 -07:00