caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* caml_oldify_local_roots takes 50% of the total runtime
@ 2006-10-25 15:49 Hendrik Tews
  2006-10-25 18:21 ` [Caml-list] " Markus Mottl
  2006-12-15 10:56 ` Hendrik Tews
  0 siblings, 2 replies; 13+ messages in thread
From: Hendrik Tews @ 2006-10-25 15:49 UTC (permalink / raw)
  To: caml-list

Hi,

I have an application (olmar[1]) for gprof tells me 

Each sample counts as 0.01 seconds.
  %   cumulative   self              self     total           
 time   seconds   seconds    calls   s/call   s/call  name    
 58.33      9.52     9.52                             caml_oldify_local_roots

that is more than half of the time is spent in
caml_oldify_local_roots. The trouble is, there is no significant
garbage to collect. If I could, I would switch off garbage
collection completely.

The ocaml part of the application takes a big tree (353040 nodes
in the profiled case) in C++ and translates it into ocaml. Some
nodes are shared in the tree and there are also circles,
therefore, every C++ node has caml_global_root for its ocaml
relative (so 350.000 caml_global_roots). When the ocaml tree is
ready it is marshaled to disk and the application exits (no need
to collect garbage).

To improve the runtime I set space_overhead to max_int, but this
didn't change much (profiling above is with max_int). Apparently,
space_overhead doesn't have really have an influence on
allocate-only programs. Finally I increase minor_heap_size until
the minor collections came down to one. This brought the ocaml
running time down from 5.7s to 1.3s. 

Is there a way to adopt the size of minor heap to the program
behaviour? (BTW 32K default minor heap sounds like 1995, not like
2006) 

>From the comments of Damien Doligez in a related thread in
http://caml.inria.fr/pub/ml-archives/caml-list/2004/07/84cd291931627c13faf56a259026885c.en.html
I got the impression that there is extra punishment for
caml_local_roots. Should the situation improve if I organize the
350.000 ocaml node pointers on the ocaml side via one local root
(asumming this information is needed not so often)?


Bye,

Hendrik


[1] http://www.cs.ru.nl/~tews/olmar/


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2006-12-15 10:56 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-10-25 15:49 caml_oldify_local_roots takes 50% of the total runtime Hendrik Tews
2006-10-25 18:21 ` [Caml-list] " Markus Mottl
2006-10-25 19:01   ` skaller
2006-10-26  9:50     ` Hendrik Tews
2006-10-26 13:48     ` Gerd Stolpmann
2006-10-27 11:36       ` Hendrik Tews
2006-10-27 13:17         ` Brian Hurt
2006-10-27 20:05           ` Robert Roessler
2006-10-27 21:16           ` Pierre Etchemaïté
2006-10-30  7:50           ` Hendrik Tews
2006-10-26  9:47   ` Hendrik Tews
2006-10-26 14:54     ` Markus Mottl
2006-12-15 10:56 ` Hendrik Tews

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).