help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Speed up startup of octave


From: Paul
Subject: Re: Speed up startup of octave
Date: Mon, 12 Aug 2013 15:44:19 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Regarding the contribution of rc files to octave's startup time, apart
from the default (and sparse) system octaverc files, it looks like the
only added file sourced on startup is my $HOME/.octaverc file, which
is minimal.

   /usr/share/octave/site/m/startup/octaverc
   /usr/share/octave/3.6.2/m/startup/octaverc
   /home/USER/.octaverc


   /home/USER/.octaverc
   ---------------------
   addpath("/c/Users/USER/Documents/MATLAB")
   format compact

The --norc shaves about 0.2s off of the startup, on average:

   $time echo pi | octave --silent --no-window-system --norc
   ans =  3.1416
   real    0m1.092s
   user    0m0.234s
   sys     0m0.763s

   $time echo pi | octave --silent --no-window-system
   ans =  3.1416
   real    0m1.279s
   user    0m0.343s
   sys     0m0.872s

I used "echo" rather than --eval to emulate a bit of the delay in
piping from vim.

Note that the actual ~/.octaverc file isn't the source of the delay.
Rather, the delay seems to be from checking for ~/.octaverc.  In fact,
getting rid of ~/.octaverc doesn't noticably change the 0.2s
difference.

Shelling out from vim adds its own delay. No doubt, a large part of
this is because I specify an interactive bash shell so as to pick up
the path, aliases, functions, and environment variables from .bashrc.
In fact, that's why I can access octave -- it's cygwin's octave being
accessed from gvim for Windows (I also use cygwin's gvim for
X-windows, but there are plenty of reasons for using gvim for Windows
as a default).

I haven't yet figured out a way to time the delay due to shelling out
from vim.  On top of that, the time command within bash seems to get
its output swallowed up when shelling out from vim.  That is, the
following returns only 3.1416 and none of the time quantities show up:

   time octave --silent --norc --no-window-system --eval pi

I'm going to have to look further into this, but at least now it seems
clear to me that the delay is only partly due to octave (though it
subjectively feels like it is the lion's share).  The rest is due to
starting up bash in interactive mode and possibly transitioning from
vim.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]