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

Improve performance with dtplyr #74

Merged
merged 1 commit into from
May 22, 2023
Merged

Conversation

johpiip
Copy link
Contributor

@johpiip johpiip commented May 22, 2023

This PR introduces dtplyr in places that have poor performance. In these places, we wish to calculate summaries from agents' tours per agent which means ~1.3-1.7M groups (agents) with ~1.7 rows (tours) on average per group. As suggested here (tidyverse/dplyr#5017) I used dtplyr instead of dplyr in key functions that I recognized to be slow.

Runtime decreased 98 % from 210 minutes to only 4 minutes.

Closes #62

@johpiip johpiip requested a review from hsl-petrhaj May 22, 2023 13:35
Copy link
Contributor

@hsl-petrhaj hsl-petrhaj left a comment

Choose a reason for hiding this comment

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

Preliminary approving this, hopefully I will get to test this later this week.

@johpiip
Copy link
Contributor Author

johpiip commented May 22, 2023

I tested this PR by running the old and new codebase and comparing the results.

@johpiip johpiip merged commit faa2eb7 into main May 22, 2023
@johpiip johpiip deleted the feat/group-by-summarise-performance branch May 22, 2023 13:45
@hsl-petrhaj
Copy link
Contributor

Should be fine to merge then.

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.

Performance issue in dplyr::group_by or dplyr::summarise
2 participants