[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 10:31:30 +0000 |
> Il giorno 04 lug 2019, alle ore 11:22, Carlo de Falco <address@hidden> ha
> scritto:
>
>
>
>> Il giorno 04 lug 2019, alle ore 11:14, Carlo De Falco <address@hidden> ha
>> scritto:
>>
>>
>>
>>> 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?
here's a more clean example, sorry.
foo.m:
#!/path/to/octave-cli -fq
fname = argv{1};
while true
fid = fopen (fname, "r");
a = fgetl (fid);
if (a != -1)
disp (a)
endif
fclose (fid);
pause (.1)
endwhile
$ mkfifo -m a+rw tmpfile
$ chmod u+x ./foo.m
$ ./foo.m tmpfile &
$ echo bar >> tmpfile
$ echo bar >> tmpfile
c.