English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Average cost of the OCaml GC
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2010-11-11 (03:59)
From: Jianzhou Zhao <jianzhou@s...>
Subject: Average cost of the OCaml GC

What is the average cost of the OCaml GC? I have a program that calls
'mark_slice' in 57% of the total execution time, and calls
'sweep_slice' in 21% of the total time, reported by Callgrind, which
is a profiling tool in Valgrind. 57% and 21% are the 'self cost' ---
the cost of the function itself ('Self Cost'), rather than the cost
including all called functions ('Inclusive Cost'). I guess
'mark_slice'  and  'sweep_slice'  are functions from OCaml GC. Are
these numbers normal?

My program calls both OCaml and C, which passes around C data types in
between. I also doubt if I defined the interface in an 'unefficient'
way that slows down the GC. Are there any rules in mind to make GC
work more efficiently?