r-lib / rlang

Low-level API for programming with R
https://rlang.r-lib.org
Other
498 stars 136 forks source link

Cache rlang version in `.rlang_cli_compat()`? #1609

Open DavisVaughan opened 1 year ago

DavisVaughan commented 1 year ago

I've wondered why lifecycle signaling is so slow, and it looks like there are two main reasons:

Screen Shot 2023-03-28 at 2 55 23 PM

This seems like a reasonable thing to cache, right?

DavisVaughan commented 1 year ago

Since this is in a standalone file, we can probably mimic .rlang_cli_has_cli() https://github.com/r-lib/rlang/blob/c55f6027928d3104ed449e591e8a225fcaf55e13/R/standalone-cli.R#L405-L419