-
Notifications
You must be signed in to change notification settings - Fork 222
Improved performance of list iterator (- 10-20%) #441
Improved performance of list iterator (- 10-20%) #441
Conversation
Codecov Report
@@ Coverage Diff @@
## main #441 +/- ##
==========================================
- Coverage 80.77% 80.63% -0.15%
==========================================
Files 372 372
Lines 22637 22726 +89
==========================================
+ Hits 18286 18324 +38
- Misses 4351 4402 +51
Continue to review full report at Codecov.
|
Thanks! Yeap, unchecked slicing makes sense 👍 |
16ff535
to
4ed6808
Compare
Also adds a slice unchecked and dispatches slice method to the unchecked. This also reduces a double assert to a single assert in safe code. As the bounds were checked at the array buffer and at the validity.
4ed6808
to
189b424
Compare
@jorgecarleitao I also added the Now the bounds are asserted |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Went through it carefully and all checks great. Left some nits to apply, but it is good to go.
Thanks a lot, @ritchie46 ! 💯
Co-authored-by: Jorge Leitao <[email protected]>
This PR elides some of the bounds checks done while iteration list values. The slicing still does bound checks and IMO should be one of the invariants of the offsets (being in bounds). I want to propose a
slice_unchecked
on theArray
trait. Let me know what you think.This optimization might also work for
FixedSizeList
if we add avalue_unchecked
to the array.