I've been using profiling of this sort for a while and I think 'time.total'
is the best mechanism that I know of for doing walltime. Of course you can
also use time.user and time.system if you prefer cpu time. The only problem
I've ever encountered is that it reports multiples of 10 millisecond s so
you can't reliably measure anything smaller or much more precisely than that
(except of course by repeated calls and an average)
As for memory, I used the property 'gc.size' quite frequently although you
have to be sure to call System.gcDo before you read from it or else you'll
get a lot of random jitter. However, if your procedure P has no side
effects then the increase in 'gc.size' will be minimal if not zero. So for
cases like that, I've found 'memory.heap' to be extremely informative. I
believe that it gives an idea of how much memory your call used in the
general sense (rather than how much memory its output and/or side effects
used).
As for some completely alternative method besides Property.get, I'm not
aware of any.
P.S. Check the docs, but I think 'gc.size' and 'memory.heap' report numbers
in different units (e.g. KB vs MB)
On Tue, Mar 11, 2008 at 5:18 AM, Torsten Anders <
[EMAIL PROTECTED]> 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