Version française
Home     About     Download     Resources     Contact us    
Browse thread
Memory allocation nano-benchmark.
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Oliver Bandel <oliver@f...>
Subject: Re: [Caml-list] Memory allocation nano-benchmark.
On Sat, Feb 12, 2005 at 12:04:32AM +1100, skaller wrote:
> On Fri, 2005-02-11 at 20:22, Frédéric Gava wrote:
> 
> > 
> > You could write;
> > for i=0 to tablesize -1 do
> >  let row1 = table.(i) in
> >  for j=0 to tablesize -1 do
> >   let row2 = row1.(j) do
> >   for k=0 to tablesize -1 do
> >    row2.(k) <- (i+1)*(j+1)*(k+1)
> >  done done done
> > 
> > and peraps you will have a faster code.
> 
> I found no difference, here are two runs:
> 
> [skaller@pelican] ~>time ./zmem 250
>  
> real    0m3.110s
> user    0m2.820s
> sys     0m0.240s
> 
> [skaller@pelican] ~>time ./zmem 250
>  
> real    0m27.732s
> user    0m2.750s
> sys     0m0.340s


Two runs, no difference?

Are you sure zmem and zmem are the same?


IMHO 

> real    0m3.110s
> user    0m2.820s
> sys     0m0.240s

and

> real    0m27.732s
> user    0m2.750s
> sys     0m0.340s

differ...




> 
> The huge 'real' time there is VM paging.
> 
> Perhaps Xavier will bless us with a comment as to
> whether invariant code motion optimisation is actually
> done in 
> 
>         table.(i).(j).(k) <- (i+1)*(j+1)*(k+1)
> 
> Using bigarray (c_layout):
>  
> real    0m27.948s
> user    0m0.770s
> sys     0m0.500s
> 
> .. 4 times faster.


?

What is faster than what?!

Is zmem zmem?
What is zmem?

Ciao,
   Oliver