cli icon indicating copy to clipboard operation
cli copied to clipboard

Eventually use `rstudioapi::getMode()` once it is available

Open DavisVaughan opened this issue 2 years ago • 1 comments

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 avatar Jul 12 '23 13:07 DavisVaughan

@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 :-)

JohannesFriedrich avatar Feb 06 '24 21:02 JohannesFriedrich

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.

TimTaylor avatar Oct 17 '24 09:10 TimTaylor