<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE message PUBLIC
  "-//MLarc//DTD MLarc output files//EN"
  "../../mlarc.dtd"[
  <!ATTLIST message
    listname CDATA #REQUIRED
    title CDATA #REQUIRED
  >
]>

  <?xml-stylesheet href="../../mlarc.xsl" type="text/xsl"?>


<message 
  url="2003/01/d89aa4bddc31c6f04c1b3b3cc50d0853"
  from="climb &lt;onlyclimb@1...&gt;"
  author="climb"
  date="2003-01-03T15:59:02"
  subject="Re: Re: [Caml-list] speed"
  prev="2003/01/99cd8b7b3ca0d9d001871a37a4eba80f"
  next="2003/01/7100c562b1af5753ac217cb7460456f7"
  prev-thread="2003/01/564b13bda6a36ad2f6b58a1b2caae8b7"
  next-thread="2003/01/7100c562b1af5753ac217cb7460456f7"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="Re: Re: [Caml-list] speed">
<msg 
  url="2003/01/d89aa4bddc31c6f04c1b3b3cc50d0853"
  from="climb &lt;onlyclimb@1...&gt;"
  author="climb"
  date="2003-01-03T15:59:02"
  subject="Re: Re: [Caml-list] speed">
</msg>
</thread>

<contents>
&gt;That said, by and large I find that when you don't go near issues of
&gt;allocation and interprocedural optimization, Java is and can be as
&gt;fast as Caml.  *However*, when you _do_ go near those things, e.g. if
&gt;you do anything I/O or string-processing-intensive, well,
&gt;
&gt;  go get a rocking chair, 'cos you're gonna have a looong wait.
&gt;
I quite agree with it. 
one part of my program (on bio sequence analyze)  is dealing with IO and string- processing. The Ocaml version is amazingly faster than java.( amazing , indeed) .
however if comes to other part ( simulation of trees ) the ocaml version is not that fast than java. The factor 2 (in fact) is not quite easy to achieve.  especially if contains some recursive types and random numbers ( so,i changed it into Ocamlgsl  Gsl_rng.t and using a faster type of rng). I found if i define tree in a recursive way( i have tried both functional style like in the page 50 in O' book and imperative style , using module of node and tree similar with java's node class and tree class), the factor is 1 or so. when  i tried to get rid of any recursive definition by using an array to contain nodes and each node only contain index of  the children , at this case the factor is 1.8 or 2 . However , i think this trick is somehow a litte  ugly .
Since i am still quite new to ocaml, can any expert tell me why recursive types reduce the speed ( or my experice above is wrong). 

Thanks
            
             
                          Yours
                                 climb
                                 onlyclimb@163.com
                                 2003-01-03



          
             



-------------------
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

</contents>

</message>

