caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Optimizing garbage collection
@ 2010-11-18 15:51 Eray Ozkural
  2010-11-19 14:54 ` [Caml-list] " Michael Ekstrand
  0 siblings, 1 reply; 11+ messages in thread
From: Eray Ozkural @ 2010-11-18 15:51 UTC (permalink / raw)
  To: caml-list

[-- 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 --]

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

end of thread, other threads:[~2010-11-23 16:43 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1832704169.1010021.1290451094930.JavaMail.root@zmbs1.inria.fr>
2010-11-23  9:48 ` [Caml-list] Optimizing garbage collection Damien Doligez
2010-11-23 13:40   ` Christophe Raffalli
2010-11-23 16:43     ` Christophe Raffalli
2010-11-18 15:51 Eray Ozkural
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 18:38           ` John Carr

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).