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] Functors, inlining and Camlp4
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2001-10-09 (15:54)
From: Nicolas barnier <barnier@r...>
Subject: [Caml-list] Functors, inlining and Camlp4

I've recently "functorized" some piece of code containing critical fragments 
(very frequently called and which process data) to broaden its use, and I 
ended up with an horrible loss of 20% up to 50% (avg 30%) of the execution 
times for my benchmark. So after profiling and checking the mailing archive, 
I've figured out that essentially the lack of inlining in functor application 
was guilty. In one of his answer, Xavier suggested to "manually" inline 
critical code, which, I guess, means to withdraw the functors and 
duplicate/specialize the module code. But I'm quite reluctant to mess it up 
this way. I hardly know anything about Camlp4, but I was wondering if it 
would be possible to automate this tedious task by preprocessing the sources 
with this very trendy and (apparently) cool tool - written by who ? ;-) 
Perhaps could it work for a subset of the functor language ?

Any hint from Daniel's fans or even the guru himself ?


-- Nicolas

"Jesus saves, but only Buddha makes incremental backups."
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr