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

complete.cases() -> vec_detect_complete() #1365

Merged
merged 1 commit into from
Sep 9, 2024

Conversation

EmilHvitfeldt
Copy link
Member

found during sparsity work. n_complete_cases() calls complete.cases() which is kinda slow compared to vctrs::vec_detect_complete().

hotel_data <- sparse_hotel_rates()
hotel_data <- sparsevctrs::coerce_to_sparse_tibble(hotel_data)

bench::mark(
  complete.cases(hotel_data),
  vctrs::vec_detect_complete(hotel_data)
)

#> # A tibble: 2 × 6
#>   expression                             min median `itr/sec` mem_alloc `gc/sec`
#>   <bch:expr>                          <bch:> <bch:>     <dbl> <bch:byt>    <dbl>
#> 1 complete.cases(hotel_data)           1.23s  1.23s     0.812      60MB        0
#> 2 vctrs::vec_detect_complete(hotel_d… 2.77ms 2.87ms   348.       66.5KB        0

@EmilHvitfeldt EmilHvitfeldt changed the title complete.cases() -> vec_detect_complete() complete.cases() -> vec_detect_complete() Sep 9, 2024
@EmilHvitfeldt EmilHvitfeldt merged commit f3bd4f4 into main Sep 9, 2024
11 checks passed
@EmilHvitfeldt EmilHvitfeldt deleted the complete.cases-vec_detect_complete branch September 9, 2024 19:28
Copy link

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 Sep 24, 2024
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.

1 participant