Skip to content

Refactor Gache for Performance and Stability#151

Open
kpango wants to merge 4 commits intobugfix/shard-distribution-biasfrom
gache-refactor-perf-v2-1877846128182509760
Open

Refactor Gache for Performance and Stability#151
kpango wants to merge 4 commits intobugfix/shard-distribution-biasfrom
gache-refactor-perf-v2-1877846128182509760

Conversation

@kpango
Copy link
Owner

@kpango kpango commented Feb 25, 2026

  • Implemented Arena-based storage in map.go to eliminate pointer scanning and reduce GC overhead.
  • Introduced O(1) Timing Wheel expiration mechanism integrated into shards.
  • Added global atomic time caching to reduce syscall frequency.
  • Implemented incremental expired processing to avoid CPU spikes.
  • Utilized sync.Pool for notification structs to minimize allocation.
  • Updated gache.go to support new Map implementation and non-blocking expiration notifications.
  • Added comprehensive functional tests covering basic operations, expiration, range, clear, and concurrency.
  • Removed obsolete map implementation tests.

PR created automatically by Jules for task 1877846128182509760 started by @kpango

kpango and others added 4 commits February 25, 2026 12:23
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Initial plan

* Add unit tests for getShardID covering all key-length and maxKeyLength scenarios

Co-authored-by: kpango <9798091+kpango@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: kpango <9798091+kpango@users.noreply.github.com>
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
@google-labs-jules
Copy link
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@kpango kpango force-pushed the bugfix/shard-distribution-bias branch 2 times, most recently from e6ed2a3 to 25c9cc2 Compare February 25, 2026 04:08
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