[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: |
Sun, 11 Aug 2013 23:16:43 +0000 (UTC) |
User-agent: |
Loom/3.14 (http://gmane.org/) |
Mike Miller <mtmiller <at> ieee.org> writes:
>On Sun, Aug 11, 2013 at 17:18:31 +0000, Paul wrote:
>> I am constantly shelling out of a text editor (vim) to pipe text
>> into octave. But octave takes seconds to launch each time. Is
>> there a way to speed it up?
>
> Do you have a lot of packages installed and auto-loaded at startup?
> In my experience, assuming Linux, this is most likely the cause of
> slow starting, not Octave itself.
>
> You can add the -f/--norc option to prevent octaverc scripts from
> running and auto-loaded packages from loading. Or you can do "pkg
> rebuild -noauto" for each package you don't need loaded all the
> time. This may speed startup quite a bit:
>
> $ time /usr/bin/octave -q --eval pi
> ans = 3.1416
>
> real 0m1.061s
> user 0m0.964s
> sys 0m0.080s
> $ time /usr/bin/octave -qf --eval pi
> ans = 3.1416
>
> real 0m0.064s
> user 0m0.044s
> sys 0m0.016s
>
>> As a nonideal solution, I can keep a command line window open with
>> an interactive octave session constantly running, then use it to
>> repeatedly source a script for which I have a separate edit session
>> constantly open. I can have a second edit session open for the
>> output of the repeatedly sourced script. This is way less
>> convenient than simply shelling out of a single edit session,
>> without having to use an extra window for octave.
>
> You could look at any of the solutions to run interactive processes
> from within vim. I just found these with some quick searching, I
> have not tested either:
>
> * https://code.google.com/p/conque/
> * https://github.com/jpalardy/vim-slime
I think it might be just my installation or host system rather than
startups. Using --verbose, I get:
executing commands from
/usr/share/octave/site/m/startup/octaverc ... done.
executing commands from
/usr/share/octave/3.6.2/m/startup/octaverc ... done.
The first is empty and the 2nd is almost empty:
read_readline_init_file (sprintf ("%s%s%s",
octave_config_info ("startupfiledir"),
filesep, "inputrc"));
if (strcmp (PAGER (), "less") && isempty (getenv ("LESS")))
PAGER_FLAGS ( \
'-e -X -P"-- less ?pB(%pB\\%):--. (f)orward, (b)ack, (q)uit$"');
endif
## This appears here instead of in the pkg/PKG_ADD file so that
## --norc will also skip automatic loading of packages.
pkg ("load", "auto");
atexit ("__finish__");
The actual time is:
time /usr/bin/octave -qf --norc --no-window-system --eval pi
ans = 3.1416
real 0m0.588s
user 0m0.171s
sys 0m0.405s
I find this actually quite acceptable, but it is being done at home
rather than in the office. It's a lot slower in the office, but I
work off network files (which might somehow cause extra delay). I
will repeat this time test in the office.
Thanks for the pointers to conque and vim-slime. It looks like an
interesting read.