Repository navigation
Reuse stored hashes for frozenset hashing and in-place set union - #8859
Conversation
Assisted-by: Codex:GPT-6
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: RustPython/RustPython/.coderabbit.yml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughSet hashing now folds stored element hashes, and in-place union merges set sources directly. Regression tests cover hash reuse, union with set and frozenset sources, and self-union. ChangesStored-hash set operations
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to No actionable issue is established; the change is mergeable after normal checks. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The changed collection operations stay within the existing set and dictionary storage model. The reviewed paths show no new trust boundary or broader authority, but unusual re-entrant and concurrent behavior has not been fully validated. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Merging this PR will improve performance by 27.72%
Performance Changes
Tip Curious why performance improved? Comment Comparing Footnotes
|
Summary
Compute the first frozenset hash from stored element hashes without calling element
__hash__methods again. In-place set union uses the same native merge path asset.update, including for set and frozenset subclasses.Follow-up to #8491, which introduced stored-hash reuse in set construction.
Performance
Release build, 512 keys; median of three samples.
AI assistance
Written with Codex (GPT-6), reviewed by a human before submission.
Summary by CodeRabbit