Skip to content

perf(partitioned): bypass gate for idle warm hits - #463

Merged
thomhurst merged 1 commit into
mainfrom
issue-429-partition-warm
Aug 28, 2026
Merged

perf(partitioned): bypass gate for idle warm hits#463
thomhurst merged 1 commit into
mainfrom
issue-429-partition-warm

Conversation

@thomhurst

Copy link
Copy Markdown
Owner

Summary

  • serve non-expired warm partition hits under the cache lock even when IdleExpiration is configured
  • enter the async mutation gate only for creation or when the LRU shows expiration pruning is due
  • keep opportunistic expiration and TryGet semantics intact
  • add a held-gate regression and permanent warm lookup benchmark

Closes #429

Benchmark

BenchmarkDotNet ShortRun, .NET 10, Windows, i7-12700K:

Case Mean Allocated
warm lookup, no expiration 11.87 ns 0 B
warm lookup, 10m idle expiration 31.05 ns 0 B

The idle path now remains a synchronous lock/dictionary/timestamp hit instead of serializing through SemaphoreSlim and sync-over-async.

Validation

  • dotnet build Kevlar.slnx -c Release
  • dotnet run --project tests/Kevlar.Tests -c Release -f net8.0 --no-build -- --timeout 5m (1,276 passed)
  • dotnet run --project tests/Kevlar.Tests -c Release -f net10.0 --no-build -- --timeout 5m (1,310 passed)
  • BenchmarkDotNet Dry and Short jobs for PartitioningBenchmarks.Warm_Lookup

Check expiration and touch warm entries under the local cache lock. Enter the async mutation gate only for creation or pending eviction work.
@coderabbitai

coderabbitai Bot commented Aug 28, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: af9bc41d-e72c-4c26-a94e-4835cdb50a7b


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@thomhurst
thomhurst merged commit 52cb9da into main Aug 28, 2026
10 checks passed
@thomhurst
thomhurst deleted the issue-429-partition-warm branch August 28, 2026 00:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

perf(partitioned): IdleExpiration forces every lookup through the single mutation gate (sync path = sync-over-async)

1 participant