⚡ Remove unused heap logic from VRAMAwareCache#81
Conversation
Removes the unused `self._heap` and associated `_reheap` logic from `VRAMAwareCache`. Eviction in this class determines items to remove by iterating or sorting `self._store.values()`, bypassing the heap completely. Re-heaping on every eviction was adding an O(N) overhead for no functional benefit. Measured performance improvement in benchmark scenario (1,000,000 entries triggering a single eviction) drops `_apply_eviction_policy` time from 0.81s down to 0.11s. Co-authored-by: SuarezPM <110942776+SuarezPM@users.noreply.github.com>
|
👋 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 New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
Removes the unused `self._heap` and associated `_reheap` logic from `VRAMAwareCache`. Eviction in this class determines items to remove by iterating or sorting `self._store.values()`, bypassing the heap completely. Re-heaping on every eviction was adding an O(N) overhead for no functional benefit. Measured performance improvement in benchmark scenario (1,000,000 entries triggering a single eviction) drops `_apply_eviction_policy` time from 0.81s down to 0.11s. Signed-off-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> Co-authored-by: SuarezPM <110942776+SuarezPM@users.noreply.github.com>
Removes the unused `self._heap` and associated `_reheap` logic from `VRAMAwareCache`. Eviction in this class determines items to remove by iterating or sorting `self._store.values()`, bypassing the heap completely. Re-heaping on every eviction was adding an O(N) overhead for no functional benefit. Measured performance improvement in benchmark scenario (1,000,000 entries triggering a single eviction) drops `_apply_eviction_policy` time from 0.81s down to 0.11s. Signed-off-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> Co-authored-by: SuarezPM <110942776+SuarezPM@users.noreply.github.com>
Removes the unused `self._heap` and associated `_reheap` logic from `VRAMAwareCache`. Eviction in this class determines items to remove by iterating or sorting `self._store.values()`, bypassing the heap completely. Re-heaping on every eviction was adding an O(N) overhead for no functional benefit. Measured performance improvement in benchmark scenario (1,000,000 entries triggering a single eviction) drops `_apply_eviction_policy` time from 0.81s down to 0.11s. Signed-off-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> Co-authored-by: SuarezPM <110942776+SuarezPM@users.noreply.github.com>
Applies Jules PR #81 (uv.lock/log churn dropped). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Pablo <suarezpm@csnat.unt.edu.ar>
|
Applied to |
💡 What: Removed$O(N)$ re-heaping penalty during evictions) that was completely unused. Eviction logic relies entirely on analyzing
self._heap, the_reheapmethod, andheapq.heappushcalls fromVRAMAwareCache.🎯 Why: The cache never actually queried or popped from the heap, meaning it was maintaining a data structure (with an
self._store.📊 Measured Improvement: In a local benchmark isolating
_apply_eviction_policywith 1,000,000 cache items, the execution time for an eviction cycle dropped from ~0.81s to ~0.11s.PR created automatically by Jules for task 12314248908657311996 started by @SuarezPM