⚡ Cache primability and stability scores in search results#104
⚡ Cache primability and stability scores in search results#104google-labs-jules[bot] wants to merge 1 commit intostablefrom
Conversation
This change optimizes the retrieval of `ReplicationOrigin` objects by caching the `primability` and `stability` scores computed during the search phase. Key changes: - `DirIdx`: Added `primability` and `stability` fields to store cached scores. Updated `__hash__` to rely only on `direction` and `index` to preserve identity semantics. - `Repliconf.search`: Populated `DirIdx` with calculated scores when a match is found. - `Repliconf.origin`: Passed cached scores from `DirIdx` to `ReplicationOrigin`. - `ReplicationOrigin`: Added `_cached_primability` and `_cached_stability` fields and updated property accessors to use these cached values if available. Performance improvement: Access time for 63k origins reduced from ~4.13s to ~0.25s (~16x speedup). Total search + access time reduced from ~4.76s to ~1.01s.
|
👋 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. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## stable #104 +/- ##
=========================================
Coverage ? 92.53%
=========================================
Files ? 9
Lines ? 750
Branches ? 0
=========================================
Hits ? 694
Misses ? 56
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
47a5ea6 to
f204e89
Compare
Cached primability and stability scores in DirIdx to optimize ReplicationOrigin instantiation.
Modified:
src/amplifyp/origin.py: UpdatedReplicationOriginto accept and use cached scores.src/amplifyp/repliconf.py: UpdatedDirIdxto store scores andRepliconfto populate and pass them.Verified with performance benchmark showing significant speedup in accessing search results. Passed all existing tests.
PR created automatically by Jules for task 7479601605716977255 started by @fangfufu