Issue
Coordinate.LeaseRead and groupLeaseRead perform c.engine.(raftengine.LeaseProvider) on every call. Each type assertion is ~1-3 ns; not a bottleneck but trivially cacheable.
Fix
- Add
lp raftengine.LeaseProvider field on Coordinate and ShardGroup.
- Set once in
NewCoordinatorWithEngine / NewShardedCoordinator (after the type assertion).
LeaseRead checks c.lp != nil instead of asserting.
Acceptance
- Same observable behavior;
LeaseRead benchmark shows reduced cycles per op.
References: PR #549 (deferred).
Issue
Coordinate.LeaseReadandgroupLeaseReadperformc.engine.(raftengine.LeaseProvider)on every call. Each type assertion is ~1-3 ns; not a bottleneck but trivially cacheable.Fix
lp raftengine.LeaseProviderfield onCoordinateandShardGroup.NewCoordinatorWithEngine/NewShardedCoordinator(after the type assertion).LeaseReadchecksc.lp != nilinstead of asserting.Acceptance
LeaseReadbenchmark shows reduced cycles per op.References: PR #549 (deferred).