I am using the internal "Profile" module to check the runtime complexity of functions in unit tests.
"Profile.getInfo" returns a list of records like this:

profileStats(calls:1001 closures:1 column:0 file:'Oz' heap:25120 line:9 name:'ForProc' samples:0)

"samples" does not work, but I found that "calls" (number of function calls) often reflects the used time quite accurately.
"heap" is useful to trace the memory consumption.

Example usage:

\switch +profile
declare
[Profile] = {Module.link ['x-oz://boot/Profile']}
Dict = {NewDictionary}
in
{Profile.mode true}
{Profile.reset}

for I in 1..1000 do
  _ = I div 2
  Dict.I := I
end

{Inspect {Profile.getInfo}}


Of course, this is an internal, undocumented feature, so use it at your own risk ;-)

Cheers,
 Wolfgang


Torsten Anders wrote:
Dear all,

I would like to compare the performance of a number of (problem-specific) distribution strategies with a set of constraint problems and with different settings (e.g., different recomputation settings). I am interested in computation time (wall time) and memory consumption.

Because I will end up with quite a lot of test cases to measure, I would like to automate this process. Is there a recommended way for doing such measurements?

Concerning runtime measurements, I plan to use the following function. DO you see any problems with this strait-forward approach?

/** %% Returns the time (in msecs) the application of P (a null-ary procedure) took.
   %% */
   fun {TimeSpend P}
      Start End
   in
      Start = {Property.get 'time.total'}
      {P}
      End = {Property.get 'time.total'}
      End - Start
   end


My problem is that I don't know how I can test the memory consumption automatically. I know about the Profiler, but as far as I can tell from its documentation the Profiler is indented only for interactive use, not for automatic measurements.

Any other ideas?

Thank you very much!

Best
Torsten

--
Torsten Anders
Interdisciplinary Centre for Computer Music Research
University of Plymouth
Office: +44-1752-233667
Private: +44-1752-558917
http://strasheela.sourceforge.net
http://www.torsten-anders.de




_________________________________________________________________________________ mozart-users mailing list [email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users


_________________________________________________________________________________
mozart-users mailing list                               
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users

Reply via email to