⚡ Bolt: Replace AHash with FxHash for faster hashmap lookups#587
⚡ Bolt: Replace AHash with FxHash for faster hashmap lookups#587
Conversation
Replaces `ahash` with `rustc-hash` in the `cbor-cose` Rust library to use `FxHashMap` instead of `AHashMap`. This eliminates the heavy transient dependencies of `ahash` (such as `getrandom` and `once_cell`), reducing the compiled binary size of the core library while maintaining extremely fast, non-cryptographic hash map lookups for properties and fingerprint caches.
|
👋 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. |
YiğitProject ID: Tip Messaging handles push notifications, emails, and SMS through one unified API |

💡 What
Replaced
ahash::AHashMapwithrustc_hash::FxHashMapinrust/cbor-cose/src/fingerprint.rsandrust/cbor-cose/src/properties.rs.🎯 Why
AHashbrings in heavier transient dependencies likegetrandomandonce_cellwhich bloat the final compiledlibcleverestricky_cbor_cose.astatic library. Since the hash maps are only used for static strings (properties and device fingerprints), we do not need HashDoS protection.FxHashprovides the same microsecond lookup performance but with zero external dependencies, making the Magisk module smaller.📊 Impact
.sobinary size when linked into the C++ Magisk module.🔬 Measurement
Verified the compilation size reduction by running
cargo build --releaseinrust/cbor-cose. Verified the logical correctness by runningcargo testwhich successfully passed all 60 tests.PR created automatically by Jules for task 16477797129175384886 started by @tryigit