Not so good:

var ls = list (1,2);
var i:int; forall i in 0 upto 21 do
  ls = rev (fold_left (fun (acc:list[int]) (x:int) => Cons(x,acc)) (rev ls) ls);
  println$ str i + " " + str (len ls);
done
~/felix>flx --test=build/release --static -c flr
~/felix>FLX_REPORT_COLLECTIONS=1 FLX_FREE_FACTOR=4 FLX_MIN_MEM=1000 time ./flr
[FLX_REPORT_COLLECTIONS] Collection report enabled
0 4
1 8
2 16
3 32
4 64
5 128
6 256
7 512
8 1024
9 2048
10 4096
11 8192
12 16384
13 32768
14 65536
15 131072
16 262144
17 524288
18 1048576
19 2097152
20 4194304
21 8388608
       16.14 real        15.17 user         0.95 sys

let ls = ref [1;2]
;;
for i= 0 to 21 do
ls := List.rev (List.fold_left (fun acc x -> x::acc) (List.rev !ls) (!ls));
print_endline ((string_of_int i) ^ " " ^(string_of_int (List.length !ls)));
done
;;
~/felix>ocamlopt.opt clr.ml -o clr
~/felix>time ./clr
0 4
1 8
2 16
3 32
4 64
5 128
6 256
7 512
8 1024
9 2048
10 4096
11 8192
12 16384
13 32768
14 65536
15 131072
16 262144
17 524288
18 1048576
19 2097152
20 4194304
21 8388608

real    0m4.625s
user    0m4.087s
sys     0m0.532s

Ocaml trashes Felix 4:1 on this test.

Reality is worse: parameters set in Felix so there's no call to the GC.

--
john skaller
skal...@users.sourceforge.net





------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
Felix-language mailing list
Felix-language@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/felix-language

Reply via email to