[ESS] any way to speed up Emacs\ESS?

Keith Ponting k.ponting at aurix.com
Thu Feb 19 11:05:36 CET 2009


For what it is worth, I had noticed some slowness under XEmacs (21.5
beta 27, 
ESS 5.3.10) - I have just tried the comparison on an 87-line function
using 
<ctrl>C <ctrl>C (ess-eval-function-or-paragraph-and-step).

With default ess-eval-visibly-p: 
   under XEmacs it took about 4 seconds to finish evaluation; 
   GNU Emacs (Vincent Goulet's 22.3-modified 2, also ESS 5.3.10), about
8 seconds.

Setting ess-eval-visibly-p to nil meant that it in either case it
finished almost
instantly. 

What I did not expect when invisible was the line containing lots of +
symbols before the next prompt (presumably these are from 'R' prompting
for the next line of the function?)
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + >

(For completeness: I am running R 2.8.1 under Windows Vista) 

Keith

P.S. ESS is wonderful - keep up the good work!

Keith Ponting
Aurix Ltd, Malvern WR14 3SZ  UK


> -----Original Message-----
> From: Martin Maechler <maechler at stat.math.ethz.ch>
> Subject: Re: [ESS] any way to speed up Emacs\ESS?
> To: Deepayan Sarkar <deepayan.sarkar at gmail.com>
> Cc: Martin Maechler <maechler at stat.math.ethz.ch>,
> 	ess-help at stat.math.ethz.ch
> Message-ID: <18842.48591.750301.331507 at stat.math.ethz.ch>
> Content-Type: text/plain; charset=us-ascii
> 
> >>>>> "DeepS" == Deepayan Sarkar <deepayan.sarkar at gmail.com>
> >>>>>     on Mon, 16 Feb 2009 09:42:20 -0800 writes:
> 
>     DeepS> On 2/16/09, Martin Maechler <maechler at stat.math.ethz.ch>
> wrote:
>     >>
>     KDH> Put               (setq ess-eval-visibly-p nil)
>     KDH> in your .emacs for
>     KDH> letting this be the default behaviour
>     >>
>     >> exactly.  We have used this as our stats "department" default
>     >> forever.
>     >>
>     >> The only (?) reasons it's not the default in ESS are
>     >>
>     >> - because the "visibility-turned-on" option is more intuitive
to
>     >> beginning users of ESS
> 
>     DeepS> And when giving live R demos in presentations...
> 
> good point.
> 
>     >> - to remain compatible to all previous versions of ESS
> 
>     DeepS> I'm curious: does anyone know why things are slow with
> visibility
>     DeepS> turned on? It's presumably a emacs22 issue, because there
> were no
>     DeepS> speed issues in emacs21
> 
> You are right.  I forgot about that (I've practically never seen the
> speed problems, as I practically never use "the visibility"), and
AFAIK
> all other ESS-corers have forgotten as well, or not found the time to
> follow up.
> 
> Help from ESS-helpers is very much appreciated.
> 
>     DeepS> As an aside, I tried defining a (crude) alternative to ess-
> eval-region
>     DeepS> that loops through a region calling ess-eval-line-and-step
> (which has
>     DeepS> no speed penalty even with visibility):
> 
>     DeepS> (defun myess-eval-region (start end)
>     DeepS> "Call ess-eval-line for each line overlapping region. "
>     DeepS> (interactive "r")
>     DeepS> (ess-force-buffer-current "Process to load into: ")
>     DeepS> (message "Starting evaluation... %s %s %s" start end
(point))
>     DeepS> (goto-char start)
>     DeepS> (comint-bol)
>     DeepS> (while (< (point) end)
>     DeepS> (ess-eval-line-and-step)))
> 
> 
>     DeepS> Unfortunately, this seems to echo the whole region first,
and
> then
>     DeepS> shows the results. Is there a simple way to force updating
> after each
>     DeepS> call? Inserting a call to (sleep-for) seems to work, but
> surely there
>     DeepS> is a better way:
> 
> probably, but all this looks like "horrible hack" / "workaround"
> and should really not be needed.
> 
> Also, I've quickly looked at my (Ubuntu 8.10) version of
emacs-snapshot.
> There, I get the impression that
>        comint-scroll-to-bottom-on-output which is an alias for
>        comint-move-point-for-output
> also does not work. If I set it to 't',  the *R* is still not auto-
> scrolled when I send R code to the buffer.
> 
> .... arrrgh...
> 
> 
>     DeepS> (defun myess-eval-region (start end)
>     DeepS> "Call ess-eval-line for each line overlapping region. "
>     DeepS> (interactive "r")
>     DeepS> (ess-force-buffer-current "Process to load into: ")
>     DeepS> (message "Starting evaluation... %s %s %s" start end
(point))
>     DeepS> (goto-char start)
>     DeepS> (comint-bol)
>     DeepS> (while (< (point) end)
>     DeepS> (progn
>     DeepS> (ess-eval-line-and-step)
>     DeepS> (sleep-for 0.001))))
> 
>     DeepS> -Deepayan
> 
>     DeepS> ______________________________________________
>     DeepS> ESS-help at stat.math.ethz.ch mailing list
>     DeepS> https://stat.ethz.ch/mailman/listinfo/ess-help




More information about the ESS-help mailing list