On Wed, Sep 27, 2006 at 12:15:20PM +0200, Peter Halacsy wrote:
> i've written a program that readsthe input and builds a large in
> memory data strucutre using hashtable and lists. I think the
> algorithm is O(n).
>
> But if I double the size of the input the running time is much higher
> as double.
[...]
I would suggest narrowing this down to a simple test case and posting
the full code to caml-list ~at~ inria dot fr. Without actual code it
is impossible to see what might be going on.
> But caml_fl_allocate that I think is related to memory allocation
> slows down my program. What is this function for? Can I set the
> initial heap size or something else?
caml_fl_allocate is the function which tries to allocate memory from
the "free list" (an internal list of blocks which have just been
freed). If it fails, then the heap is expanded. As such, all
allocation functions eventually turn into a call to caml_fl_allocate.
You can set the initial (major) heap site by using the 'h' option in
OCAMLRUNPARAM. See:
http://caml.inria.fr/pub/docs/manual-ocaml/manual024.html
Rich.
--
Richard Jones, CTO Merjis Ltd.
Merjis - web marketing and technology - http://merjis.com
Internet Marketing and AdWords courses - http://merjis.com/courses - NEW!
Merjis blog - http://blog.merjis.com - NEW!
.