Skip to content

Conversation

@DavisVaughan
Copy link
Member

@DavisVaughan DavisVaughan commented Oct 3, 2025

While more ergonomic, it comes with overhead of inject(), as_string(), caller_env(), and more, which isn't worth it for us

cross::bench_branches(\() {
  library(lifecycle)
  
  # trigger the 8 hour warning once
  deprecate_soft("1.1.0", I("my thing"), details = "for this reason")

  bench::mark(
    deprecate_soft("1.1.0", I("my thing"), details = "for this reason"),
    iterations = 100000
  )
})
#> # A tibble: 2 × 7
#>   branch                 expression                     min median `itr/sec` mem_alloc `gc/sec`
#>   <chr>                  <bch:expr>                  <bch:> <bch:>     <dbl> <bch:byt>    <dbl>
#> 1 feature/delayed-assign "deprecate_soft(\"1.1.0\",… 38.5µs 40.2µs    24101.    8.56KB     61.4
#> 2 main                   "deprecate_soft(\"1.1.0\",… 42.5µs   44µs    22322.    8.56KB     60.7

This is the main other overhead besides signal_stage(). So those 4µs are going to actually matter if we remove signal_stage() from the equation too.

While more ergonomic, it comes with overhead of `inject()`, `as_string()`, `caller_env()`, and more, which isn't worth it for us
@DavisVaughan DavisVaughan merged commit bbfb664 into main Oct 3, 2025
12 checks passed
@DavisVaughan DavisVaughan deleted the feature/delayed-assign branch October 3, 2025 19:12
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.

2 participants