On 02-04-2008, Jon Harrop <[EMAIL PROTECTED]> wrote: > On Wednesday 02 April 2008 20:52:32 Sylvain Le Gall wrote: >> On 02-04-2008, Jon Harrop <[EMAIL PROTECTED]> wrote: >> I am not sure of this... I think this penalty can be removed by >> providing .cmxa and .cmx files (but i am not sure). I think this point >> should need a little more attention to be sure. Frankly, i would like to >> test this before saying that there is an 'order of magnitude'. > > You cannot circumvent this problem by suppling extra files to the current > OCaml compilers. You used to be able to circumvent this problem using the > ocamldefun tool which uses whole program transformation to remove the > functors before the OCaml compilers see the code. However, I believe > ocamldefun has not been updated and no longer works (since OCaml 3.06 or so, > IIRC). > > Here is a simple program to benchmark the costs of these abstractions: > > $ ocamlopt -inline 1000 functor.ml -o functor > $ ./functor > Direct > Took 0.304019s > Functional abstraction > Took 1.30408s > Functor abstraction > Took 1.80811s > > So using a functor is 6x slower in this case. >
You are right, i have the same results. > > I have already discovered many problems with F# but they are very minor > compared to the main problems with OCaml. While there is no theoretical > reason why OCaml cannot catch up (e.g. by leveraging tools like LLVM and > maybe the JVM's concurrent GC) I do not believe this will ever happen. > FYI, even if it is not exactly what you expect, someone has ported the OCaml compiler to JVM (i.e. you ocamljava that replace ocamlc/ocamlopt). He has done a fairly huge amount of works to make it happen (http://ocamljava.x9c.fr/). Now, even if it doesn't have some downgraded performance, i must admit that the real problem when programming is not only performance but also ability to modify what you have written (expressiveness/clarity?). This help to create efficient implementation by being able to rewrite/check program in an efficient way. If people has the ability to write efficient and correct algo in ASM, i think we won't be here to discuss the issue about functor ;-) I.e. functor are my syntactic sugar ;-) (always better than parametrized java class) Anyway, thank you for this interesting discussion about inlining. I know that someday i will come to F#... But since it doesn't run on Linux, it will take time for me. Regards, Sylvain Le Gall --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "ocaml-developer" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/ocaml-developer?hl=en For other OCaml forums, see http://caml.inria.fr/resources/forums.en.html -~----------~----~----~----~------~----~------~--~---
