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

speedup with to_lists() #34

Merged
merged 2 commits into from
Apr 23, 2024
Merged

speedup with to_lists() #34

merged 2 commits into from
Apr 23, 2024

Conversation

dougbrn
Copy link
Collaborator

@dougbrn dougbrn commented Apr 22, 2024

This PR uses to_lists() in place of to_flat() and apply() for the by=None count_nested case and in reduce to offer a 5-10x speedup.

It does introduce one limitation to reduce in that the nested structures cannot have overlapping column names, this will be less of an issue once #33 is addressed. I propose we wait to resolve this overlap issue until after #33 and just make a separate issue for now.

Copy link

codecov bot commented Apr 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.68%. Comparing base (025ad96) to head (fe20c57).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #34      +/-   ##
==========================================
+ Coverage   95.63%   95.68%   +0.05%     
==========================================
  Files          14       14              
  Lines         618      626       +8     
==========================================
+ Hits          591      599       +8     
  Misses         27       27              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

github-actions bot commented Apr 22, 2024

Before [025ad96] After [9844d26] Ratio Benchmark (Parameter)
2.36±0.8s 1.73±0.9s ~0.73 benchmarks.time_computation
3.54k 640 0.18 benchmarks.mem_list

Click here to view all benchmarks.

@dougbrn dougbrn requested a review from wilsonbb April 23, 2024 17:02
Copy link
Contributor

@wilsonbb wilsonbb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An exciting speedup! Just added a comment suggesting we use a different form of join.

src/nested_pandas/nestedframe/core.py Show resolved Hide resolved
@dougbrn dougbrn merged commit 659b639 into main Apr 23, 2024
11 checks passed
@dougbrn dougbrn deleted the to_lists_speedup branch April 23, 2024 21:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants