Eventually use `rstudioapi::getMode()` once it is available
https://github.com/r-lib/lifecycle/issues/167 revealed that lifecycle signaling is slow due to cli eventually calling rstudioapi::getVersion() and rstudioapi::versionInfo()$mode.
I've made a request for rstudioapi::getMode(), which should be massively faster than versionInfo()$mode
https://github.com/rstudio/rstudioapi/issues/280
If that is implemented and lands on CRAN, cli should use that here: https://github.com/r-lib/cli/blob/7eb56ebc4c315ecfef74148881b15a522c8946bf/R/aab-rstudio-detect.R#L35-L36
https://github.com/rstudio/rstudioapi/issues/279 should also make getVersion() much faster too.
So there is nothing actionable for cli currently, but I wanted to have this issue so we don't forget to update this
@DavisVaughan What´s the current status for the different packages cli, rstudioapiand lifecycle concerning this issue? I have big performance problems in my code because of the repeated call of utils::readCitationFile(), as mentioned here.
Thanks for a short comment :-)
This was improved in the latest release of rstudioapi (https://github.com/rstudio/rstudioapi/releases/tag/v0.17.0). Have made a PR (https://github.com/r-lib/cli/pull/733) that changes the printing of a slowish ~data frame~ tibble in RStudio from ~18 seconds, to ~3 seconds with rstudioapi v0.17.0.