[ESS] Slow reading of multiline input

Vitalie S. vitosmail at rambler.ru
Fri Jan 9 10:16:41 CET 2009


If eval is hidden (i.e. (ess-eval-region (point-min) (point-max) t) ) issue goes away. Not probably what you want but here is my workaround.
 
I bound C-Ret to my-ess-eval (short chunks or lines) and C-S-Ret to my-ess-eval-hidden (long chunks):
 
 
(defun my-ess-eval ()
"Evaluate visibly line or region if mark is active"
   (interactive)
   (if (and transient-mark-mode mark-active)
	(ess-eval-region (mark) (point) nil)
     (call-interactively 'ess-eval-line-and-step))
)
 
(defun my-ess-eval-hidden ()
"Evaluate invisibly line or region if mark is active"
   (interactive)
   (if (and transient-mark-mode mark-active)
	;(call-interactively 'ess-eval-region)
	(ess-eval-region (mark) (point) t)
     (call-interactively 'ess-eval-line-and-step))
)
 
HTH.


On Fri, 09 Jan 2009 02:17:33 +0100, Stavros Macrakis <macrakis at alum.mit.edu> wrote:

> Reading and evaluating multi-line commands in ESS is extremely slow on my
> system. (Windows XP (32-bit); R 2.8.0; ESS 5.3.8)
>
> For example (with an R process already running):
>
> (progn
>   (set-buffer (get-buffer-create "foo"))
>   (erase-buffer)
>   (insert
> "c(\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n)")
> ;100 lines
>   (list
>    (current-time-string)
>    (ess-eval-region (point-min) (point-max) nil) ; why is 3rd arg not
> optional?
>    (current-time-string)))
>
> reports
>
> ("Thu Jan 08 19:54:53 2009" (1 104) "Thu Jan 08 19:55:04 2009")
>
> That's 11 seconds!  The same command with spaces (even 100000 spaces!)
> instead of newlines is instantaneous.
>
> The same thing happens if I paste the same 100-line command into the *R*
> buffer and hit RET.
>
> How can I fix this or work around it?
>
> Thanks,
>
>              -s
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> ESS-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/ess-help




More information about the ESS-help mailing list