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

Eventually use rstudioapi::getMode() once it is available #621

Closed
DavisVaughan opened this issue Jul 12, 2023 · 2 comments
Closed

Eventually use rstudioapi::getMode() once it is available #621

DavisVaughan opened this issue Jul 12, 2023 · 2 comments
Labels
upkeep maintenance, infrastructure, and similar

Comments

@DavisVaughan
Copy link
Member

r-lib/lifecycle#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
rstudio/rstudioapi#280

If that is implemented and lands on CRAN, cli should use that here:

d$ver <- if (d$api) asNamespace("rstudioapi")$getVersion()
d$desktop <- if (d$api) asNamespace("rstudioapi")$versionInfo()$mode

rstudio/rstudioapi#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

@gaborcsardi gaborcsardi added the upkeep maintenance, infrastructure, and similar label Oct 31, 2023
@JohannesFriedrich
Copy link

JohannesFriedrich commented Feb 6, 2024

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

TimTaylor added a commit to TimTaylor/cli that referenced this issue Oct 17, 2024
This commit conditions on the presence of rstudioapi 0.17.0. If
satisfied then use the new getMode() function
(https://github.com/rstudio/rstudioapi/releases/tag/v0.17.0).
Otherwise maintain the old behaviour.

Annecdotally this printing a slowish data frame went from
~18 seconds to ~3 seconds with this commit and rstudioapi v0.17.0.
@TimTaylor
Copy link
Contributor

TimTaylor commented Oct 17, 2024

This was improved in the latest release of rstudioapi (https://github.com/rstudio/rstudioapi/releases/tag/v0.17.0). Have made a PR (#733) that changes the printing of a slowish data frame tibble in RStudio from ~18 seconds, to ~3 seconds with rstudioapi v0.17.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upkeep maintenance, infrastructure, and similar
Projects
None yet
Development

No branches or pull requests

4 participants