help-octave
[Top][All Lists]
Advanced

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

Re: Octave profile timing


From: David Grundberg
Subject: Re: Octave profile timing
Date: Thu, 15 Apr 2010 09:37:53 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100317 Thunderbird/3.0.4

On 04/13/2010 06:27 PM, Anne Ikonen wrote:
Hi,
I was looking for MATLAB timing profile from OCTAVE, but didn't find.
Then I made a plan to measure OCTAVE timings. Several alternatives were found:
1) Inserting
     t(linenum, callcounter) = clock();
timelines in the code. This works, but isn't automatic, so big files cause lots of additional work done.
2) Inserting
     t(linenum, callcounter) = clock();
timelines in the code AUTOMATICALLY before actually calling the scripts or functions.
    Then you get:
       myfunction.m  ----> modified myfunction.m including timelines.
This also works, but needs a facility to maintain timelines in m-files. An easy automatic code looks for suitable lines in the m-file and inserts a timeline everywhere. However, this modifies m-files, which isn't very good thing in the long run. 3) Could simulate OCTAVE engine and call eval for every octave code fraction with timing measurement:
     octaveline   ---->       eval ( 'timestart; octaveline ; timestop;')
this also works, but simulation can become rather complicated trying to do all the same things as octave engine does. 4) Could dispatch octave engine "eval"-functionality to include timing start and stop around executed code. How this can be done? eval is a builtin function in octave. And timing results need to be collected also. 5) Can find out average times for every octave action during eval and report results as estimations of algorithm times.
    This is not exact, but gives a good view of timings in an algorithm.
This works, but isn't automatic, so big files cause lots of additional work done. And exceptional timings are not found this way. 6) Could try to use external facilities to measure timing points to octave engine proceedings. Works and shows code location timings, but since code location contents are not exactly known and can even vary, isn't the best possible way to measure octave timings. Is MATLAB profile on/off available for octave somewhere outside octave pages? It wasn't mentioned in octave manuals.
Sincerely
Jari-Pekka Ikonen
email: address@hidden <mhtml:%7B346A1EDF-6639-4BF9-A047-A83A328AABDF%7Dmid://00000362/%21x-usc:mailto:address@hidden>


Octave doesn't have a profiler yet, but I think no one would protest if there were one.

While writing m-code and shell scripts can give some results, I want Octave specialized to do profiling. I want statement-per-statement measurements. I want per-function measurements. I think the best way is to change the core Octave so that it can profile m-code on its own merit. A rigorous way to implement a profiler is by extending or subclassing the parse tree evaluator (written in C++). Someone needs to be interested in this, take on this project and make a prototype implementation. That's all it takes. (I realize this is on the help list, but anyway.)

I'm sorry I can't give a more helpful answer.

hth,
David


reply via email to

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