-
-
Notifications
You must be signed in to change notification settings - Fork 16
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
Rewrite reshaping functions to improve performance #285
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
Co-authored-by: Indrajeet Patil <[email protected]>
Codecov Report
@@ Coverage Diff @@
## main #285 +/- ##
==========================================
+ Coverage 85.60% 85.74% +0.14%
==========================================
Files 53 54 +1
Lines 3695 3753 +58
==========================================
+ Hits 3163 3218 +55
- Misses 532 535 +3
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
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.
Thanks for the amazing work, @etiennebacher!
I didn't even know about stack()
and unstack()
👀
Feel free to merge when you think this is ready. Also, all code snippets relevant for development, like benchmarking, can live in the /dev
folder (https://github.com/easystats/datawizard/tree/main/dev).
Sorry, I'm working on a paper revision, and this PR included to much code for a timely review ;-) |
These are really impressive performance improvements! Well done @etiennebacher! |
data_to_wide()
anddata_to_long()
are rewritten to usestack()
andunstack()
instead ofreshape()
(this was suggested in nathaneastwood/poorman#48). This significantly improves the performance of these two functions and doesn't modify any of the use cases and tests.Benchmarks
I just show the results here, the code to remake the benchmarks is in
WIP/_BENCHMARKS_RESHAPE.R
: