English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
[Caml-list] Some clarifications to the language shootout page
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-11-26 (13:22)
From: Pierre Weis <pierre.weis@i...>
Subject: Re: [Caml-list] Some clarifications to the language shootout page
Hi list,

Here is the conclusion of our mail exchange with Manuel:

> ====
> Just one more thing, I have changed the Scheme code a very little bit to
> make it more similar to the Caml code. That is, I have changed the 
> construction of the row vectors. The original initialization 
>   (mx (make-vector rows 0.0))
> was breaking the CFA because mx what not 
> correctly typed vector of vector of double. I have replaced it with:
>   (mx (make-vector rows (make-vector 0 0.0)))
> Then, you should compile with:
>   bigloo -v2 -Obench foo.scm  -copt "-O3 -fomit-frame-pointer"
> On my machine with this two modifications I see an improvement of about 17%.
> It is still insufficient to defeat Ocaml but we are getting a little closer  [:-)] 
> -- 
> Manuel

Hi Manuel,

As you should have noticed, I did not try to optimize anything in the
Caml code: I just tried a litteral translation from Scheme to Caml. In
effect, the original Caml code was not optimally clear (difficult to
read and difficult to compile) and was compared to a (relatively)
clear Scheme code. Mere translation of the Scheme code to Caml just
improves the runtime by a factor of 2 or so. As you surely know
already, I was obliged to change the initialization, since

   (mx (make-vector rows 0.0))

is ill-typed in Caml.

This is amazing that now this well-typed Caml version, once translated
back to Scheme, improves the original Scheme version!

I think that this proves, once more, that our languages are not as
different as people think they are :)


Pierre Weis

INRIA, Projet Cristal, Pierre.Weis@inria.fr, http://pauillac.inria.fr/~weis/

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