Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inplace arithmetic #3709

Merged
merged 4 commits into from
Jun 16, 2022
Merged

inplace arithmetic #3709

merged 4 commits into from
Jun 16, 2022

Conversation

ritchie46
Copy link
Member

@ritchie46 ritchie46 commented Jun 15, 2022

  • multiply
  • addition
  • subtraction
  • division

can now be in place IFF the underlying data is not shared. This is not implemented for division by literals because we compile division JIT via https://docs.rs/strength_reduce/latest/strength_reduce/. We can look into making that mutable later.

More operations will follow. Especially for long boolean chains this is interesting.

This is possible thanks to jorgecarleitao/arrow2#1061

image

Improvement upstream

See: jorgecarleitao/arrow2#1076
image

@github-actions github-actions bot added the rust Related to Rust Polars label Jun 15, 2022
@codecov-commenter
Copy link

Codecov Report

Merging #3709 (e6c958c) into master (55acdb6) will decrease coverage by 0.02%.
The diff coverage is 83.63%.

@@            Coverage Diff             @@
##           master    #3709      +/-   ##
==========================================
- Coverage   61.79%   61.76%   -0.03%     
==========================================
  Files         436      437       +1     
  Lines       72527    72680     +153     
==========================================
+ Hits        44817    44890      +73     
- Misses      27710    27790      +80     
Impacted Files Coverage Δ
...lars/polars-core/src/series/arithmetic/borrowed.rs 35.36% <ø> (ø)
polars/polars-io/src/ipc.rs 48.58% <ø> (ø)
polars/polars-core/src/chunked_array/arithmetic.rs 67.41% <72.00%> (+4.54%) ⬆️
polars/polars-core/src/utils/mod.rs 49.81% <73.91%> (+1.24%) ⬆️
polars/polars-core/src/chunked_array/ops/apply.rs 24.09% <100.00%> (+0.88%) ⬆️
...lars/polars-core/src/chunked_array/ops/downcast.rs 84.61% <100.00%> (+1.43%) ⬆️
polars/polars-core/src/series/arithmetic/owned.rs 100.00% <100.00%> (ø)
...olars-lazy/src/physical_plan/expressions/binary.rs 52.10% <100.00%> (-0.43%) ⬇️
...polars-core/src/series/implementations/duration.rs 10.30% <0.00%> (-11.63%) ⬇️
.../polars-core/src/chunked_array/logical/duration.rs 42.30% <0.00%> (-11.54%) ⬇️
... and 20 more

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 55acdb6...e6c958c. Read the comment docs.

@github-actions github-actions bot added the python Related to Python Polars label Jun 15, 2022
@ritchie46 ritchie46 merged commit 74081ac into master Jun 16, 2022
@jorgecarleitao jorgecarleitao deleted the mut_arithm branch June 16, 2022 10:16
@jorgecarleitao
Copy link
Collaborator

If I understand, a factor of almost 2? 🚀

@ritchie46
Copy link
Member Author

If I understand, a factor of almost 2? rocket

Yes! :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
python Related to Python Polars rust Related to Rust Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants