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

speed up get_args() helper #933

Merged
merged 1 commit into from
Mar 20, 2023
Merged

speed up get_args() helper #933

merged 1 commit into from
Mar 20, 2023

Conversation

simonpcouch
Copy link
Contributor

With main dev:

library(parsnip)

bench::mark(
  total = fit(linear_reg(), mpg ~ ., mtcars),
  iterations = 25
)
#> # A tibble: 1 × 6
#>   expression      min   median `itr/sec` mem_alloc `gc/sec`
#>   <bch:expr> <bch:tm> <bch:tm>     <dbl> <bch:byt>    <dbl>
#> 1 total        7.65ms   8.04ms      120.    7.19MB     67.6

With this PR:

#> # A tibble: 1 × 6
#>   expression      min   median `itr/sec` mem_alloc `gc/sec`
#>   <bch:expr> <bch:tm> <bch:tm>     <dbl> <bch:byt>    <dbl>
#> 1 total        6.62ms   6.78ms      145.    7.19MB     56.5

Taken together with the other PRs this morning, fit(linear_reg(), mpg ~ ., mtcars) is now free of any calls to select(), filter(), or mutate()!😮

Created on 2023-03-17 with reprex v2.0.2

Copy link
Member

@EmilHvitfeldt EmilHvitfeldt left a comment

Choose a reason for hiding this comment

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

nice and clean! approved

@simonpcouch simonpcouch merged commit 48efe84 into main Mar 20, 2023
@simonpcouch simonpcouch deleted the get-args branch March 20, 2023 12:29
@github-actions
Copy link

github-actions bot commented Apr 5, 2023

This pull request has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.

@github-actions github-actions bot locked and limited conversation to collaborators Apr 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants