Version française
Home     About     Download     Resources     Contact us    
Browse thread
how to "disable" GC?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Eijiro Sumii <eijiro_sumii@a...>
Subject: Re: [Caml-list] how to "disable" GC?
From: "Thomas Fischbacher" <Thomas.Fischbacher@Physik.Uni-Muenchen.DE>
> > 2. Some programs get much slower for larger heaps, even though they
> >    don't seem to trigger any GC.  An example is such programs is given
> >    below.  Why is this?  (There also exist programs that are not
> >    affected at all, so this is not because of the initialization
> >    overhead of the runtime system.)
> 
> Quite in general, Cache hierarchy may be an issue here.

This is right, but let me clarify my question: Why is _anything_
heap-allocated, for example in the program below (given in my previous
message)?  According to the assembly and intermediate code in
ocamlopt, there is indeed something heap-allocated in the else-clause
of tak, but I don't know what this is for...  Are floting-point
numbers heap-allocated in ocamlopt on sparc??

| (**********************************************************************)
| let rec tak x y z =
|   if y >= x then z else
|   tak (tak (x -. 1.0) y z) (tak (y -. 1.0) z x) (tak (z -. 1.0) x y) in
| let n = 10.0 in
| print_int (int_of_float (1000000.0 *. tak (n *. 3.0) (n *. 2.0) (n *. 1.0)));
| print_newline ()
| (**********************************************************************)

> setenv OCAMLRUNPARAM 's=1000'
> time ./tak.ocamlopt
11000000
3.54u 0.01s 0:03.56 99.7%
> setenv OCAMLRUNPARAM 's=1000000000'
> time ./tak.ocamlopt
11000000
6.83u 1.50s 0:08.80 94.6%