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

G. Jay Kerns gkerns at ysu.edu
Mon Feb 16 02:32:55 CET 2009


Dear Chuck,

Wow!  That was exactly what I was looking for.  Thank you very much.

Best,
Jay

On Sun, Feb 15, 2009 at 8:14 PM, Charles C. Berry <cberry at tajo.ucsd.edu> wrote:
> On Sun, 15 Feb 2009, G. Jay Kerns wrote:
>
>> Dear ESS-help,
>>
>> I like Emacs/ESS very much, and have used it on and off for a year
>> now.  I have tried lots of things, looking for the "best" (whatever
>> that means).  I keep coming back to Emacs/ESS, partly because I like
>> its philosophy, and partly for its sheer power.  I am this moment on a
>> laptop with 32-bit Ubuntu Intrepid;  I am using GNU-Emacs 22.2-0 and
>> ESS 5.13-11.
>>
>> Consider the following example code, just for the sake of discussion:
>>
>> x <- rnorm(100)
>> y <- rnorm(100)
>> x + y
>> exp(x)
>> length(y)
>> min(x)
>> max(y)
>>
>> If I put this in a frame "scratch.R" and send it to the [*R*] buffer
>> with Eval region, it takes approx 1.5 seconds on my system before
>> everything is done and the "Finished evaluation" message appears.  It
>> takes around the same amount of time if I yank the above text into the
>> [*R*] buffer and press RET.
>>
>> On the other hand, I can copy-paste the same code into a terminal and
>> it finishes instantaneously (well, before my finger leaves Ctrl+v).  I
>> get similar speed with Sciviews-K, for instance.
>>
>> Now, the other merits of Emacs/ESS are more than enough to outweigh a
>> few seconds here and there, but the waiting time seems to be
>> proportional to the script length, and I am wondering:  is there some
>> trick, or something I can put in my .emacs (for example), or some
>> other way to streamline things to make these evaluations faster?
>
> Does this help?
>
> C-h v ess-eval-region RET
>
>        ess-eval-region is an interactive Lisp function in `ess-inf.el'.
>        (ess-eval-region START END TOGGLE &optional MESSAGE)
>
>        Send the current region to the inferior ESS process.
>        With prefix argument toggle the meaning of `ess-eval-visibly-p';
>        this does not apply when using the S-plus GUI, see
>        `ess-eval-region-ddeclient'.
>
> 'Nother words try selecting a region, then sending
>
>        C-u C-c C-r
>
> (assuming standard bindings)
>
> and see what you get.
>
> On my Windows XP PC, selecting all of a *.R file and doing that is ever so
> slightly longer than source("that.file.R") and about 70 times faster than
> plain old C-c C-r.
>
> It does echo some prompts (and this is version 5.3.8 in case this behavior
> is different now) , but if you can live with that, this might do.
>
> HTH,
>
> Chuck
>
>
>>
>> I did some quick searching on Google, the ESS manual, etc, and didn't
>> see anything immediately relevant.  If it can't be fixed, that's fine,
>> but if there is something I am missing I would really appreciate some
>> pointers.
>>
>> Jay
>>
>> BTW:  I did see the below thread, and even tried it out, but it didn't
>> seem to work for me.
>>
>> https://stat.ethz.ch/pipermail/ess-help/2009-January/005073.html
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> --
>>
>> ***************************************************
>> G. Jay Kerns, Ph.D.
>> Associate Professor
>> Department of Mathematics & Statistics
>> Youngstown State University
>> Youngstown, OH 44555-0002 USA
>> Office: 1035 Cushwa Hall
>> Phone: (330) 941-3310 Office (voice mail)
>> -3302 Department
>> -3170 FAX
>> E-mail: gkerns at ysu.edu
>> http://www.cc.ysu.edu/~gjkerns/
>>
>> ______________________________________________
>> ESS-help at stat.math.ethz.ch mailing list
>> https://stat.ethz.ch/mailman/listinfo/ess-help
>>
>
> Charles C. Berry                            (858) 534-2098
>                                            Dept of Family/Preventive
> Medicine
> E mailto:cberry at tajo.ucsd.edu               UC San Diego
> http://famprevmed.ucsd.edu/faculty/cberry/  La Jolla, San Diego 92093-0901
>
>
>



-- 

***************************************************
G. Jay Kerns, Ph.D.
Associate Professor
Department of Mathematics & Statistics
Youngstown State University
Youngstown, OH 44555-0002 USA
Office: 1035 Cushwa Hall
Phone: (330) 941-3310 Office (voice mail)
-3302 Department
-3170 FAX
E-mail: gkerns at ysu.edu
http://www.cc.ysu.edu/~gjkerns/




More information about the ESS-help mailing list