Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Reduced bound checks #1142

Merged
merged 1 commit into from
Jul 7, 2022

Conversation

ritchie46
Copy link
Collaborator

@ritchie46 ritchie46 commented Jul 7, 2022

In line to what we already do for Utf8 this PR omits bound checks for Dictionary and List types when converting from a Growable to arrays. The bound checks can be removed because of the invariants of the Growable struct.

I added assertions for debug builds for all the data types where we removed the bounds checks so that implementation bugs will be caught.

Finally I dispatched the From impls to Struct::to to make the code more dry.

@codecov
Copy link

codecov bot commented Jul 7, 2022

Codecov Report

Merging #1142 (54ea8de) into main (98e4913) will increase coverage by 0.03%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #1142      +/-   ##
==========================================
+ Coverage   83.59%   83.63%   +0.03%     
==========================================
  Files         366      366              
  Lines       35901    35906       +5     
==========================================
+ Hits        30013    30031      +18     
+ Misses       5888     5875      -13     
Impacted Files Coverage Δ
src/array/growable/dictionary.rs 88.34% <100.00%> (+11.02%) ⬆️
src/array/growable/list.rs 97.14% <100.00%> (ø)
src/array/growable/utf8.rs 95.89% <100.00%> (-0.06%) ⬇️
src/io/ipc/read/reader.rs 95.98% <0.00%> (-0.67%) ⬇️
src/io/ipc/read/schema.rs 94.56% <0.00%> (-0.32%) ⬇️
src/array/utf8/mod.rs 86.58% <0.00%> (+0.95%) ⬆️
src/array/binary/mod.rs 90.12% <0.00%> (+1.23%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 98e4913...54ea8de. Read the comment docs.

@jorgecarleitao jorgecarleitao changed the title reduce and debug assert bound checks Reduced bound checks Jul 7, 2022
@jorgecarleitao jorgecarleitao added the enhancement An improvement to an existing feature label Jul 7, 2022
@jorgecarleitao jorgecarleitao merged commit e4947cc into jorgecarleitao:main Jul 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement An improvement to an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants