Skip to content

[ISSUE #65] Defer segment panel suppliers until the cache misses - #78

Merged
mxsm merged 1 commit into
developfrom
mxsm/fix-28-cache-allocation
Nov 28, 2026
Merged

mxsm merged 1 commit into
developfrom
mxsm/fix-28-cache-allocation

Conversation

@mxsm

@mxsm mxsm commented Nov 28, 2026

Copy link
Copy Markdown
Owner

Closes #65

Use the existing panel entry on a cache hit before constructing its per-request initialization supplier. A missing or concurrently retired entry still goes through the per-key atomic loader and the same acquire/release rules. The new SDK concurrency regression verifies one reservation and 32 distinct IDs on a simultaneous cold start.

Compared with the exact #74 merge commit in two GC-profiled forks per workload (JDK 25, 1/8 threads). Single-thread normalized allocation changed from 12.0065 to 0.0062 B/ID; its two original fork means were 0.0065 and 24.0065. The high-allocation diagnostic fork recorded 1,701 captured-supplier samples. All three matched candidate diagnostics had zero cache-stack samples. At eight threads the unrelated queue-lock allocation remained (0.3253 → 0.3562 B/ID). Throughput was 32.51 → 33.62 M IDs/s at one thread and 19.56 → 19.65 M IDs/s at eight.

Checks: Maven wrapper JMH module and dependencies packaged with tests for both variants; cached-SDK cold-access and eviction regressions passed. The Markdown and JSON under docs/performance include per-fork iteration arrays, sampled types/stacks, host parameters and reproduction commands.

@mxsm
mxsm merged commit 2e6413a into develop Nov 28, 2026
1 check passed
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.

Profile and reduce allocations on segment cache hits

1 participant