-
Notifications
You must be signed in to change notification settings - Fork 222
2nd (safe) rewrite of MutableDictionaryArray #1561
2nd (safe) rewrite of MutableDictionaryArray #1561
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #1561 +/- ##
==========================================
- Coverage 83.08% 83.02% -0.06%
==========================================
Files 389 391 +2
Lines 42640 42786 +146
==========================================
+ Hits 35427 35525 +98
- Misses 7213 7261 +48
☔ View full report in Codecov by Sentry. |
(Don't merge yet, I'll add a few very quick tests) |
Nice! Thanks for the quick turnaround. We might also explore making the index type generic, so that we can support all unsigned indexes and get better cache coherence. But that's definitely not a blocker for this PR. |
0aa5354
to
52654bb
Compare
As in You would need to convert is back and forth to |
@ritchie46 ok, using
Benches seem to improve a bit further by ~10%: (now 1.7x from original for utf8, 3.5x for u64) dict_utf8 time: [141.11 µs 141.44 µs 141.82 µs]
change: [-11.502% -11.251% -10.984%] (p = 0.00 < 0.05)
Performance has improved.
dict_u64 time: [35.081 µs 35.169 µs 35.259 µs]
change: [-8.4965% -8.1730% -7.8369%] (p = 0.00 < 0.05)
Performance has improved. Can clean it up a bit and push it too here if it's of interest. |
(Pushed the I think it only makes sense because we fully manage |
Since #1559 has been merged, I'll have to rebase this on main again, ok then... 🤦 |
…the array instead of the hash->hash map" (jorgecarleitao#1559)" This reverts commit b2017d7.
d83c8d1
to
50b33fa
Compare
Ok, I've rebased on revert of the revert, should be ok now. Tests were added. Unit-value hashmap added = waiting on feedback from @ritchie46 (if I missed something and there's some gaps we can always revert that part if needed). Otherwise, nothing else left to do in this PR I think unless there's any particular comments, so should be good to go. (clippy error in CI is some unrelated spurious network error) |
Thanks for doing the rewrite @aldanor. Good to go. |
As suggested by @ritchie46, using hashbrown's raw-entry API (flipped
<K, usize>
to<usize, K>
though).Need to be very careful to not use any default map API though since it will break map consistency (like .insert(), .collect(), etc).
Benchmarks are roughly the same as in #1555, not slower, not faster; miri should be happy though.