[Caml-list] no_scan_tag and int array

2010-03-06 Thread ygrek
Hello, Consider this code: open Printf let measure f = let t = Unix.gettimeofday () in let () = f () in printf "%.4f sec" (Unix.gettimeofday () -. t) let () = let gc () = for i = 1 to 10 do Gc.full_major () done in let a = Array.make 4_000_000 0 in measure gc; printf " normal %u (

Re: [Caml-list] no_scan_tag and int array

2010-03-06 Thread Goswin von Brederlow
ygrek writes: > Hello, > > Consider this code: > > open Printf > > let measure f = > let t = Unix.gettimeofday () in > let () = f () in > printf "%.4f sec" (Unix.gettimeofday () -. t) > > let () = > let gc () = for i = 1 to 10 do Gc.full_major () done in > let a = Array.make 4_000_000 0

Re: [Caml-list] no_scan_tag and int array

2010-03-07 Thread ygrek
On Sun, 07 Mar 2010 01:48:51 +0100 Goswin von Brederlow wrote: > What polymorphic array function? I don't think Array.length is a good > test as it looks at the header of the array to see how many words the > array has. Sure, I've tested this elsewhere with Array.iter and other. Array.length her

Re: [Caml-list] no_scan_tag and int array

2010-03-29 Thread Damien Doligez
Hello, On 2010-03-06, at 10:26, ygrek wrote: > So, as expected, setting No_scan_tag on the array of integers prevents GC > from uselessly > scanning the huge chunk of memory. Looks like polymorphic array functions > still work fine and > GC correctly reclaims array memory when it is not refere