From: Hendrik Tews <H.Tews@cs.ru.nl>
To: caml-list@inria.fr
Subject: caml_oldify_local_roots takes 50% of the total runtime
Date: Wed, 25 Oct 2006 17:49:17 +0200 [thread overview]
Message-ID: <17727.34685.561877.977822@tandem.cs.ru.nl> (raw)
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/
next reply other threads:[~2006-10-25 15:49 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-25 15:49 Hendrik Tews [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=17727.34685.561877.977822@tandem.cs.ru.nl \
--to=h.tews@cs.ru.nl \
--cc=caml-list@inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).