[Top][All Lists]

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

Re: Reduce startup time for script processing?

From: Carlo De Falco
Subject: Re: Reduce startup time for script processing?
Date: Thu, 4 Jul 2019 09:14:42 +0000

> Il giorno 04 lug 2019, alle ore 09:26, Andreas Weber <address@hidden> ha 
> scritto:
> Dear all,
> I'm using GNU Octave 3.8.2 on an embedded system (RPi3) to execute
> scripts and print the results multiple times.
> foo.m:
> printf ("bar\n")
> $ octave -f --no-gui foo.m
> This takes 1,3s on my system. Is there anything I can do to reduce the
> "startup" time? Preload Octave into RAM? It would be okay if the first
> start is slow and the subsequent runs are fast.
> Thank you, Andy

This is just a guess, I'm not actually sure it would be any better, but you 
could maybe try keep octave running and communicate via a named pipe?


#!/path/to/octave-cli -fq

fname = argv{1};
while true
  fid = fopen (fname, "r");
  a = fgetl (fid);
  if (a != -1)
    disp (a)
  fclose (fid);
  pause (.1)    

$ chmod u+x ./foo.m &
$ ./foo.m tmpfile
$ echo bar >> tmpfile
$ echo bar >> tmpfile


reply via email to

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