Repository navigation
Conversation
This branch has not been deployed
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.
Stacked on #587. Custom list sizing was building an immutable index and then copying it into a dictionary for each write. Update the required private dictionary directly, and preserve cheap unchanged updates. The shared expiration test now avoids its narrow scheduling window, with fake-time coverage for small/large and scoped lists.
Validation at
988ab9ff: Release build, formatting, and 2,479 tests passed / 22 existing skips. Final combined core: 2,517 passed / 22 skips; Redis cache/lock validation: 778 passed / 18 skips, including the revised expiration test in all four provider fixtures. Push CI and PR CI passed.Still held for performance review: compatible custom sizing with cloning disabled remains 3.28× main's time / about 300× allocation at 10,000 items. This reduces overhead but does not eliminate the cost of preserving concrete-dictionary callbacks. The read-only option remains explicit.
Verification and implementation details
Base: #587 at
f891a9b0808cdea5585ce393b78be1827b78c6ed. Head:988ab9fff045af312715da76d69ccc24228b42e3.The custom-calculator path skips indexing and updates one private dictionary copy. Rejected replacements retain the previous value, expiration and tracked size. Unchanged list additions reuse values and reapply the list expiration without rerunning the calculator. Existing comparer and cloning rules remain. No public API or option-default change.
Regression-first evidence: the allocation budget failed before the change; a separate unchanged-update regression caught unnecessary copying in the initial optimization and was corrected before publication. Coverage includes both cloning modes. An injected 200 ms pause reproduced the original shared expiration-test failure in all seven core fixtures. The revised shared test uses a permanent surviving item and verifies whole-key expiry on a fresh list. Twelve fake-time cases cover overlapping finite expirations on small/large and scoped lists. Redis's existing return-count and permanent-key TTL semantics are preserved.
Final measurements: BenchmarkDotNet 0.15.8, .NET 10.0.14 arm64, Apple M4 Max, one launch, three warmups, seven measured iterations. Each operation adds then removes one item after warmup; a fixed clock prevents background expiry. Main
be10785c, previous #587 and this candidate were loaded in separate assembly contexts with SHA-256 verification and identical bound-delegate calls. Twenty-four measured cases cover 1,000/10,000 items, cloning on/off, and compatible/read-only sizing. These measurements do not establish cold-write or contention costs.The candidate is about 16% faster than the previous stack for 10,000-item compatible sizing, with about 3% less allocation. Cloning-on compatible sizing is faster than main and uses about half its allocation in these integer-list cases. Read-only sizing avoids the full dictionary copy but still allocates immutable update structures. The guide now states the remaining linear allocation cost and scopes its DateTime.Kind note accurately.
Redis 8.10.3 ran against an isolated combined candidate including #586, using source references and explicit registration of the shared contracts. The 30 lock cases and 12 added direct/scoped cache cases remain an isolated validation overlay; durable provider registration work is separate. Existing six Hybrid concurrency and three FastCloner core skips are retained. The final combined source-provider build passed with two existing ASPIRE010 warnings after an isolated RabbitMQ MessagePack 2.5.303 pin; unmodified RabbitMQ main still fails NU1902. Fresh binary API checks passed. The core AppHost dependency correction is extracted separately in #599. No workflow changes, merge, or manual release.