caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: skaller <skaller@users.sourceforge.net>
To: ls-ocaml-developer-2006@m-e-leypold.de
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Multiplication of matrix in C and OCaml
Date: Sat, 10 Feb 2007 01:22:33 +1100	[thread overview]
Message-ID: <1171030953.5302.51.camel@rosella.wigram> (raw)
In-Reply-To: <rqirebaafx.fsf@hod.lan.m-e-leypold.de>

On Fri, 2007-02-09 at 11:32 +0100,
ls-ocaml-developer-2006@m-e-leypold.de wrote:
> ls-ocaml-developer-2006@m-e-leypold.de writes:
> 
> > optimizations. I'd feel better if the code is benchmarked in a way
> > that the result of the multiplication is output to a file and to
> > subtract the constant contribution of that to the run time that the
> > time is measured for various problem sizes (number of matrices). 
> 
> Correction: ... the constant contribution of writing the result to a
> file should be subtracted from the run time by measuring with various
> problem sizes.
> 
> Hope that is understandable now.

There is no need for that IMHO. The right way to benchmark simple
things like matrix operations AND simultaneously validate them
is to evaluate known laws of arithmetic, such as the associative
law, on various samples.

This doesn't require any I/O, nor a 'known correct' program
to generate the comparison data.

Generating the samples is harder .. I once used things like
Fibonacci to generate input for integer calculator tests.
You really want to run these benchmarks for at least 5 minutes
and randomly to eliminate cache effects.

If you can generate increasing sized problems based on a single
linear integer parameter, my Python test harness can handle
randomising the tests, run multiple processes, 
and also draw a nice plot of the results, such as these:

http://felix.sourceforge.net/speed/en_flx_perf_0005.html
http://felix.sourceforge.net/speed/en_flx_perf_0012.html

full sources etc are here to read:

http://felix.sourceforge.net/speed/en_flx_perf_top.html

or you can grab from Felix svn archive (the test harness
is independent of Felix). Or I can email to you (saves
building Felix just to get the test harness ..)

Ocamlopt scores quite well thank you! This data is from
two AMD64 machines running Ubuntu Linux and is the result
of HOURS of run time.

I don't know if it is cache, random context switches, or what,
but on my boxes variations up to 20% on tests under 5 seconds are
normal. Note the measurements are real time. Other measurements
are suspect .. you really SHOULD count VM paging for example.


-- 
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net


  reply	other threads:[~2007-02-09 14:22 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-07 23:42 Frédéric Gava
2007-02-08  2:14 ` [Caml-list] " Jacques Garrigue
2007-02-08  9:27   ` Frédéric Gava
2007-02-08  9:38     ` Frédéric Gava
2007-02-08 12:08     ` Jacques Garrigue
2007-02-08  9:56   ` Frédéric Gava
2007-02-08 10:45     ` Xavier Leroy
2007-02-08 15:16       ` Frédéric Gava
2007-02-09  2:58         ` Jacques Garrigue
2007-02-09  9:06           ` ls-ocaml-developer-2006
2007-02-09 10:32             ` ls-ocaml-developer-2006
2007-02-09 14:22               ` skaller [this message]
2007-02-09 21:47                 ` ls-ocaml-developer-2006
2007-02-09 21:55                   ` Andrej Bauer
2007-02-09 22:36                     ` ls-ocaml-developer-2006
2007-02-09 23:53                       ` Jon Harrop
2007-02-10  1:41                         ` ls-ocaml-developer-2006
2007-02-10  2:24                           ` Jon Harrop
2007-02-10 14:41                             ` ls-ocaml-developer-2006
2007-02-10 14:52                               ` Jon Harrop
2007-02-10 15:51                                 ` ls-ocaml-developer-2006
2007-02-10 16:10                                   ` Xavier Leroy
2007-02-10 16:11                                   ` Jon Harrop
2007-02-10 14:55                               ` Mattias Engdegård
2007-02-11 13:13                             ` Christophe Raffalli
2007-02-10  1:10                     ` Brian Hurt
2007-02-10  1:16                       ` Robert Roessler
2007-02-09 23:56                 ` Jon Harrop
2007-02-09 12:05             ` Jon Harrop
2007-02-09 12:35               ` ls-ocaml-developer-2006
2007-02-09 13:50             ` Brian Hurt
2007-02-09 14:23               ` Gerd Stolpmann
2007-02-09 14:24 Frederic GAVA

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1171030953.5302.51.camel@rosella.wigram \
    --to=skaller@users.sourceforge.net \
    --cc=caml-list@yquem.inria.fr \
    --cc=ls-ocaml-developer-2006@m-e-leypold.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).