From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Hendy Subject: Re: Bug? R: Org babel block execution *drastically* slower than in ESS session directly Date: Thu, 1 Nov 2012 13:17:08 -0500 Message-ID: References: <874nlappb1.fsf@tajo.ucsd.edu> <878vam1jvh.fsf@tajo.ucsd.edu> <3477.1351723988@alphaville> <11876.1351784283@alphaville> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=e89a8fb2062ef6b87004cd7306c0 Return-path: Received: from eggs.gnu.org ([208.118.235.92]:59784) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TTzKJ-0007Ju-EC for emacs-orgmode@gnu.org; Thu, 01 Nov 2012 14:17:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TTzKH-0002Vr-Ge for emacs-orgmode@gnu.org; Thu, 01 Nov 2012 14:17:11 -0400 Received: from mail-oa0-f41.google.com ([209.85.219.41]:59299) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TTzKH-0002Vi-88 for emacs-orgmode@gnu.org; Thu, 01 Nov 2012 14:17:09 -0400 Received: by mail-oa0-f41.google.com with SMTP id k14so3195961oag.0 for ; Thu, 01 Nov 2012 11:17:08 -0700 (PDT) In-Reply-To: <11876.1351784283@alphaville> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: nicholas.dokos@hp.com Cc: cberry@tajo.ucsd.edu, emacs-orgmode@gnu.org --e89a8fb2062ef6b87004cd7306c0 Content-Type: text/plain; charset=UTF-8 On Thu, Nov 1, 2012 at 10:38 AM, Nick Dokos wrote: > John Hendy wrote: > > > o run top (or whatever equivalent is available on your OS) and see > > whether the CPU (or one of the CPUs) gets pegged at 100% > utilization > > and stays there. If yes, that's an indication of an infinite loop > > somewhere. > > > > - quit any other instances of emacs/R > > - start `top` in terminal > > - execute block > > - Use '<' '>' to sort back and forth between cpu and ram > > > > Observations > > - R is at 80-100% cpu for about 5sec > > - Then emacs shifts to fairly constant ~100% cpu usage > > - After about a minute, the minibuffer expands to ~1/3 of the window > height and fills with the csv > > data > > - Finished after ~5min total time > > - So, R took about 5sec, emacs took another 5min to finish > > > > > > So not an infinite loop. That's progress ;-) > > Perhaps emacs is thrashing? If you are on linux, use swapon -s > or (perhaps better) iostat, or (perhaps even better, at least if > you are on the Gnome 2.x desktop[fn:1]), run the system monitor > applet, click Properties, enable all the monitored resources > (cpu, mem, net, swap, load, disk) and watch it while you are > running the test: in particular, check memory and swap. If you > are swapping even a little bit, that's enough to cause severe > performacne problems[fn:2], which can be cured by using less memory > (so stop any memory hogs from running) or by adding memory. > > Top can also show you memory and swap so maybe that's the quickest > way to check. > > It's not swap... :) $ free total used free shared buffers cached Mem: 3978864 2427132 1551732 0 122072 509140 -/+ buffers/cache: 1795920 2182944 Swap: 0 0 0 Best regards, John > Nick > > Footnotes: > > [fn:1] You can pobably do this in other desktops but I have no > experience with them, so no guidance to give. > > [fn:2] My old laptop with 1GB of memory would swap whenever I ran mairix > to index my mail: it would take 30 minutes or so to finish. My > new(er) laptop has 4GB and finishes in 30 seconds: memory usage > peaks at about 2.5 GB. > > --e89a8fb2062ef6b87004cd7306c0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Thu, Nov 1, 2012 at 10:38 AM, Nick Dokos <nicholas.dokos@hp.com> wrote:
John Hendy <jw.h= endy@gmail.com> wrote:

> =C2=A0 =C2=A0 o run top (or whatever equivalent is available on your O= S) and see
> =C2=A0 =C2=A0 =C2=A0 whether the CPU (or one of the CPUs) gets pegged = at 100% utilization
> =C2=A0 =C2=A0 =C2=A0 and stays there. If yes, that's an indication= of an infinite loop
> =C2=A0 =C2=A0 =C2=A0 somewhere.
>
> - quit any other instances of emacs/R
> - start `top` in terminal
> - execute block
> - Use '<' '>' to sort back and forth between cpu= and ram
>
> Observations
> - R is at 80-100% cpu for about 5sec
> - Then emacs shifts to fairly constant ~100% cpu usage=C2=A0
> - After about a minute, the minibuffer expands to ~1/3 of the window h= eight and fills with the csv
> data
> - Finished after ~5min total time
> - So, R took about 5sec, emacs took another 5min to finish
> =C2=A0
>

So not an infinite loop. That's progress ;-)

Perhaps emacs is thrashing? If you are on linux, use swapon -s
or (perhaps better) iostat, or (perhaps even better, at least if
you are on the Gnome 2.x desktop[fn:1]), run the system monitor
applet, click Properties, enable all the monitored resources
(cpu, mem, net, swap, load, disk) and watch it while you are
running the test: in particular, check memory and swap. If you
are swapping even a little bit, that's enough to cause severe
performacne problems[fn:2], which can be cured by using less memory
(so stop any memory hogs from running) or by adding memory.

Top can also show you memory and swap so maybe that's the quickest
way to check.


It's not swap... :)

=
$ free
total =C2=A0 =C2=A0 =C2=A0 used =C2=A0 =C2= =A0 =C2=A0 free =C2=A0 =C2=A0 shared =C2=A0 =C2=A0buffers =C2=A0 =C2=A0 cac= hed
Mem: =C2=A0 =C2=A0 =C2=A0 3978864 =C2=A0 =C2=A02427132 =C2=A0= =C2=A01551732 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A00 =C2=A0 =C2=A0 122072 =C2= =A0 =C2=A0 509140
-/+ buffers/cache: =C2=A0 =C2=A01795920 =C2=A0 =C2=A02182944
Swap: =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A00 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A00 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A00

<= div>

Best regards,
John
= =C2=A0
Nick

Footnotes:

[fn:1] You can pobably do this in other desktops but I have no
=C2=A0 =C2=A0 =C2=A0 =C2=A0experience with them, so no guidance to give.
[fn:2] My old laptop with 1GB of memory would swap whenever I ran mairix =C2=A0 =C2=A0 =C2=A0 =C2=A0to index my mail: it would take 30 minutes or so= to finish. =C2=A0My
=C2=A0 =C2=A0 =C2=A0 =C2=A0new(er) laptop has 4GB and finishes in 30 second= s: memory usage
=C2=A0 =C2=A0 =C2=A0 =C2=A0peaks at about 2.5 GB.


--e89a8fb2062ef6b87004cd7306c0--