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

mutate() performance improvements #4858

Merged
merged 26 commits into from Feb 24, 2020
Merged

mutate() performance improvements #4858

merged 26 commits into from Feb 24, 2020

Conversation

romainfrancois
Copy link
Member

No description provided.

@romainfrancois
Copy link
Member Author

The first change is to make new_grouped_df() slightly faster by updating tibble::new_tibble() to more carefully deal with attributes in tidyverse/tibble#717

image

->

image

@romainfrancois
Copy link
Member Author

skipping o_rows <- vec_order(vec_c(!!!rows, .ptype = integer())) and using the new internal vec_sprinkle() instead of vec_slice(vec_c(!!!chunks, .ptype = ptype), o_rows) gives a nice boost when organizing chunks into the right positions:

image

@romainfrancois
Copy link
Member Author

This is starting to be reasonable, with both changes from tidyverse/tibble#717

image

src/mutate.cpp Outdated Show resolved Hide resolved
src/mutate.cpp Outdated Show resolved Hide resolved
src/mutate.cpp Outdated Show resolved Hide resolved
src/mutate.cpp Outdated Show resolved Hide resolved
src/mutate.cpp Outdated Show resolved Hide resolved
src/mutate.cpp Outdated Show resolved Hide resolved
R/mutate.R Outdated Show resolved Hide resolved
@romainfrancois
Copy link
Member Author

I think I've incorporated suggestions from both @lionel- and @DavisVaughan now. My next step is to pursue re-injecting hybrid evaluation, but this is something that I'd like to do in a different branch.

@romainfrancois romainfrancois marked this pull request as ready for review February 18, 2020 09:03
@romainfrancois
Copy link
Member Author

Now that r-lib/vctrs#834 is merged, perhaps we can merge this

@romainfrancois romainfrancois merged commit e5ca96d into master Feb 24, 2020
@romainfrancois romainfrancois deleted the perf_mutate branch February 24, 2020 08:25
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.

None yet

3 participants