Repository navigation
Conversation
- Pass the load token as one nullable parameter instead of a variadic that only ever held zero or one. - Share the under-lock recheck of load, acquire and View.load as shard.beginLoadUnlessCached, and the shard/flight-group lookup as flightFor. - Len and Bytes read the shard sizes without snapshotting every counter. - Remove comments that repeat what the code says; document instead that a stale token makes shard.set a silent no-op.
andared
force-pushed
the
simplify_load_bookkeeping
branch
from
October 12, 2026 08:50
b59f10e to
cceef44
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refactor with no intended change in behaviour.
setValue,setNegative,storeandshard.setas one nullable*loadTokenparameter instead of a variadictokens ...*loadTokenthat only ever held zero or one.core.load,core.acquireandView.load, is nowshard.beginLoadUnlessCached. The view passesisType[T]so that a hit of another type still loads.idx := c.shardIndex(key); g, s := c.flights[idx], c.shards[idx]is nowflightFor, on bothcoreandView.LenandBytesread only the shard sizes instead of building a fullStatssnapshot, which loaded all 15 atomic counters of every shard.shard.setnow documents the non-obvious part: a stale token makes the write a silent no-op. Comments in tests explain intent and are left as they are.Checklist
make testandmake lintpass (go test -race ./...,golangci-lint run: 0 issues)Len/Bytesonly drop workCHANGELOG.md: no API change; theLen/Bytesinternals are noted under Unreleased