From: Eray Ozkural <examachine@gmail.com>
To: caml-list <caml-list@yquem.inria.fr>
Subject: Optimizing garbage collection
Date: Thu, 18 Nov 2010 17:51:46 +0200 [thread overview]
Message-ID: <AANLkTi=_oPMzTXgSyna1uouzqK6hm9Cw7gTXdvDTpjEn@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 2068 bytes --]
A program I wrote constructs a lot of small lists, and strings and discards
them. It's a search algorithm. I profiled this code and saw that garbage
collection takes significant time.
In C++, we can write custom allocators to optimize the data structures that
cause such slowdowns. Any recommended strategies in ocaml?
Best,
Call graph in gprof output on linux:
granularity: each sample hit covers 2 byte(s) for 0.00% of 8680.47 seconds
index % time self children called name
0.00 1.31 3777/13406323 caml_alloc [139]
0.00 2.45 7076/13406323 caml_alloc_small [94]
0.00 6.42 18532/13406323 caml_copy_double [119]
0.05 405.30 1169992/13406323 caml_alloc_string [16]
0.10 721.02 2081381/13406323 caml_check_urgent_gc [27]
0.48 3507.65 10125565/13406323 caml_garbage_collection
[3]
[1] 53.5 0.63 4644.15 13406323 caml_minor_collection [1]
2.13 2625.29 13406323/13406323
caml_major_collection_slice [5]
2.25 2014.36 26812646/26812646 caml_empty_minor_heap [6]
0.13 0.00 13406323/13406323 caml_final_do_calls [308]
-----------------------------------------------
<spontaneous>
[2] 40.4 0.66 3508.19 caml_call_gc [2]
0.03 3508.16 10125565/10125565 caml_garbage_collection
[3]
-----------------------------------------------
0.03 3508.16 10125565/10125565 caml_call_gc [2]
[3] 40.4 0.03 3508.16 10125565 caml_garbage_collection [3]
0.48 3507.65 10125565/13406323 caml_minor_collection [1]
0.03 0.00 10125565/10125627
caml_process_pending_signals [429]
-----------------------------------------------
--
Eray Ozkural, PhD candidate. Comp. Sci. Dept., Bilkent University, Ankara
http://groups.yahoo.com/group/ai-philosophy
http://myspace.com/arizanesil http://myspace.com/malfunct
[-- Attachment #2: Type: text/html, Size: 2601 bytes --]
next reply other threads:[~2010-11-18 15:51 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-18 15:51 Eray Ozkural [this message]
2010-11-19 14:54 ` [Caml-list] " Michael Ekstrand
2010-11-19 15:49 ` Eray Ozkural
2010-11-20 2:20 ` Eray Ozkural
2010-11-21 18:13 ` Alexandre Pilkiewicz
2010-11-21 19:26 ` Eray Ozkural
[not found] ` <577267187.967802.1290367612809.JavaMail.root@zmbs1.inria.fr>
2010-11-22 15:10 ` Damien Doligez
2010-11-22 16:27 ` Mauricio Fernandez
2010-11-22 16:42 ` Sylvain Le Gall
2010-11-22 18:07 ` [Caml-list] " Eray Ozkural
2010-11-22 21:14 ` Jon Harrop
2010-11-22 23:13 ` Eray Ozkural
2010-11-23 15:54 ` Jon Harrop
2010-11-24 22:35 ` Goswin von Brederlow
2010-11-22 18:38 ` [Caml-list] " John Carr
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='AANLkTi=_oPMzTXgSyna1uouzqK6hm9Cw7gTXdvDTpjEn@mail.gmail.com' \
--to=examachine@gmail.com \
--cc=caml-list@yquem.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