help-octave
[Top][All Lists]
Advanced

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

Re: .oct function vs external program and text file exchange


From: Daniel Arteaga
Subject: Re: .oct function vs external program and text file exchange
Date: Mon, 17 Jan 2011 15:54:03 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; ca-ES; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7

Al 14/01/11 17:22, En/na Przemek Klosowski ha escrit:

Your workflow goes through five phases:

- writing of parameters in Octave,
- system() overhead of starting your executable,
- reading of data in your C++ code,
- calculation,
- output in C++ and input in Octave.

The actual amount of time spent in each one depends on your particular
case, e.g. how much data is involved. Doing it in an .oct function would
essentially reduce it to the calculation, and you can find out exactly
how much time it takes by modifying your C++ to calculate and print the
time from after reading the data to just before writing it out. Then,
wrap your Octave code to write the params, call system() and read the
results in the tic/toc pair, and subtract the C++ time from the
toc() value---it'll be your overhead.

Thanks for your suggestions. I measured it, and the overhead it is around 8 ms (Core 2 Duo @ 3 GHz). The amount of exchanged data is fairly small (around 20 lines of text).

Daniel




reply via email to

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