Skip to content

performance improvements - #2

Merged
mpenet merged 2 commits into
mainfrom
copilot/implement-feature-1-2-3-4-5a-6-7
Apr 13, 2026
Merged

performance improvements#2
mpenet merged 2 commits into
mainfrom
copilot/implement-feature-1-2-3-4-5a-6-7

Conversation

@mpenet

@mpenet mpenet commented Apr 13, 2026

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI and others added 2 commits April 13, 2026 09:17
- Item 1: Segment pre-creation with 75% fill threshold
- Item 2: Branchless alignment in aligned-frame-size
- Item 3: Binary search in find-segment-for-offset
- Item 4: Cache current segment in volatile field on Queue
- Item 5: Use ByteBuffer.slice(index, length) in try-read-one!
- Item 6: Fused lrbFrontier method on ILongRingBuffer
- Item 7: Volatile boolean for cursor-dirty instead of atom

fix: address code review feedback - fix pre-creation base-offset, use integer threshold, clearer binary search

- Fix critical bug: pre-create segment with temp file + atomic rename instead of
  wrong base-offset. Pre-created segment now always usable at roll time.
- Replace float division threshold with integer arithmetic (capacity - capacity/4)
- Use bit-shift-right instead of unsigned-bit-shift-right in binary search
- Remove unused segment-precreate-fill-ratio constant

Agent-Logs-Url: https://github.com/mpenet/k7/sessions/cb0fbabb-c116-4070-bd98-89de2903848d

Co-authored-by: mpenet <106390+mpenet@users.noreply.github.com>

refactor: extract atomic-move-opts constant to avoid per-roll allocation

Agent-Logs-Url: https://github.com/mpenet/k7/sessions/cb0fbabb-c116-4070-bd98-89de2903848d

Co-authored-by: mpenet <106390+mpenet@users.noreply.github.com>
@mpenet mpenet changed the title Copilot/implement feature 1 2 3 4 5a 6 7 performance improvements Apr 13, 2026
@mpenet
mpenet merged commit 1571b01 into main Apr 13, 2026
2 checks 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.

2 participants