* Re: Re: [Caml-list] speed
@ 2003-01-03 15:58 climb
0 siblings, 0 replies; only message in thread
From: climb @ 2003-01-03 15:58 UTC (permalink / raw)
To: caml-list; +Cc: Chet Murthy
>That said, by and large I find that when you don't go near issues of
>allocation and interprocedural optimization, Java is and can be as
>fast as Caml. *However*, when you _do_ go near those things, e.g. if
>you do anything I/O or string-processing-intensive, well,
>
> go get a rocking chair, 'cos you're gonna have a looong wait.
>
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2003-01-03 15:59 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-03 15:58 Re: [Caml-list] speed climb
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox