Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] O'Caml vs C++: a little benchmark revisited
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: malc <malc@p...>
Subject: [Caml-list] O'Caml vs C++: a little benchmark revisited
First line for each test shows icc(gcc)'s timing, second ocaml's

lists
0.903(1.201)
1.304
arrays
0.397(0.397)
1.200(0.829 if loop was unrolled)
rev
4.707(14.073)
2.892
memory
1.191(1.069)
1.793
tree
1.064(0.854)
6.737(2.400 in case of manual/functor specialization)

lists deque 1.570(0.758)

Modified sources:
http://algol.prosalg.no/~malc/silly.tar.gz

(Linux kernel patch 2.4.19 was used for rev test)

Conclusion.

C++:
Tends to optimize out some computations if the result wasnt used.
Strings/streams are slow.

OCaml:
Polymorphic functions are slow.
Insn scheduler is less than perfect.
One must learn to live with existing floating point constraints.

-- 
mailto:malc@pulsesoft.com
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners