[ESS] Slow help culprit found!

Vitalie S. spinuvit.list at gmail.com
Sat Oct 23 12:01:39 CEST 2010



Dear ESS Core,

I've looked into the ess-help code motivated by a very slow \C-c\C-v, which I
reported last month (http://thread.gmane.org/gmane.emacs.ess.general/4695).

There was a change introduced recently.

The function `ess-find-help-file' was modified to call newly added
`ess-get-help-aliases-list'.

The latest takes awfully lot (4 sec) on my machine (Intel Core 2, 2.13 Ghz,
2GB), with 12 attached packages.

The rationale of calling that function in `ess-find-help-file', is somewhat
elusive to me:

(ess-uniq-list (append (ess-g     et-help-files-list)
                       (ess-get-help-aliases-list)   
                       (mapcar 'list
                               (ess-get-object-list
                                ess-current-process-name))))

It examines only *attached* packages, and thus, brings only duplication
(anything else?) of already comprehensive (but efficient) `ess-get-object-list'.
Moreover , `ess-get-help-aliases-list' does not cache anything and rereads all
the RDS files each time one calls \C-c\C-v.

In addition, given the huge number of object, 'ess-uniq-list' is time
consuming and is used redundantly. Once in the `ess-find-help-file' and in the
code of `ess-get-help-aliases-list'.

Also, the construct (mapcar 'list ...) probably could be dispensed with, since
`ess-uniq-list' works quite happily directly on the list of strings returned by
`ess-get-words-from-vector'.

With your permission, I would like to suggest to make the "help-aliases"
functionality available only on \C-u prefix. Also enhancing it, to search all
the installed packages not only loaded ones.

Thanks, 
Vitalie.


sessionInfo:
R version 2.12.0 (2010-10-15)
Platform: i386-pc-mingw32/i386 (32-bit)

locale:
[1] LC_COLLATE=English_United States.1252 
[2] LC_CTYPE=English_United States.1252   
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                          
[5] LC_TIME=English_United States.1252    

attached base packages:
[1] stats     datasets  grid      graphics  utils     grDevices methods  
[8] base     

other attached packages:
 [1] sos_1.3-0           brew_1.0-4          Rgraphviz_1.27.0   
 [4] graph_1.26.0        fortunes_1.4-0      latticeExtra_0.6-14
 [7] lattice_0.19-13     RColorBrewer_1.0-2  ggplot2_0.8.8      
[10] proto_0.3-8         reshape_0.8.3       plyr_1.2.1         

loaded via a namespace (and not attached):
[1] tools_2.12.0



More information about the ESS-help mailing list