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

recode() is very slow due to signal_stage() #6881

Closed
mgirlich opened this issue Jul 12, 2023 · 1 comment
Closed

recode() is very slow due to signal_stage() #6881

mgirlich opened this issue Jul 12, 2023 · 1 comment

Comments

@mgirlich
Copy link

Most of the time is spend in signal_stage(). This makes recode() so slow that it can't really be used in some situations anymore.

char_vec <- sample(c("a", "b", "c"), 10, replace = TRUE)
bench::mark(
  recode = dplyr::recode(char_vec, a = "Apple", b = "Banana")
)
#> # A tibble: 1 × 6
#>   expression      min   median `itr/sec` mem_alloc `gc/sec`
#>   <bch:expr> <bch:tm> <bch:tm>     <dbl> <bch:byt>    <dbl>
#> 1 recode        1.9ms   2.62ms      335.    3.54MB     10.7

Created on 2023-07-12 with reprex v2.0.2

I also opened an issue in lifecycle: r-lib/lifecycle#167

@DavisVaughan
Copy link
Member

We will track in r-lib/lifecycle#167

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

No branches or pull requests

2 participants