emacs-ess / ESS

Emacs Speaks Statistics: ESS
https://ess.r-project.org/
GNU General Public License v3.0
620 stars 162 forks source link

Eldoc delays with generic functions #1088

Open lionel- opened 3 years ago

lionel- commented 3 years ago

The time for querying the arguments of generic functions increases with the number of attached packages. This causes delays while typing or moving the cursor within generic functions. These delays are less annoying with Emacs 27 and interruptible background commands but still perceptible.

library(vctrs)
system.time(.ess_funargs("vec_cast"))
#>    user  system elapsed
#>   0.439   0.002   0.443

library(tidyverse)
system.time(.ess_funargs("vec_cast"))
#>    user  system elapsed
#>   1.061   0.005   1.073

This doesn't concern non-generic functions:

system.time(.ess_funargs("vec_slice"))
#>    user  system elapsed
#>   0.031   0.000   0.032
lionel- commented 3 years ago

Removing from next because this is much less annoying with Emacs 27 and interruptible background commands. Also this only happens on the first query thanks to caching.