From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 04968BBAF for ; Thu, 11 Nov 2010 04:59:56 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AoABANL42kxKfVK0kGdsb2JhbACUQo1zCBUBAQEBCQkMBxEDH6Uri3iFIyOIZAEBAwWFRQSEWoV9iSg X-IronPort-AV: E=Sophos;i="4.59,181,1288566000"; d="scan'208";a="86754432" Received: from mail-wy0-f180.google.com ([74.125.82.180]) by mail1-smtp-roc.national.inria.fr with ESMTP; 11 Nov 2010 04:59:55 +0100 Received: by wyg36 with SMTP id 36so691970wyg.39 for ; Wed, 10 Nov 2010 19:59:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=lixc58Wn3Kz7Y3vjd9UB1Q2vn7QVcB7/rI3NtJBax3Y=; b=J3XNOTu6H9H3sn2v0Q5hjZdCf+Ua5LIKdSkUCY/Aen2R7hOw2U6qpxJisowWCPQU87 pN9rHSxWpjBoRRuoa4E0YJoP6WKW5fdBa3K93APJjA2X1MvlvXZBOcdlBtaJ2pY8QJvE QBEofJW5ffL7dZiT1HB1jZaUi4CtEyJuUh7o4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; b=agwGnYEHkNxawjBaqsiAzFonKhP3J12x05oxXXS+qQjuTxflAkkLMZt8oEYT1GIbHs BnLUWff7QBQp80AkyFZBVusEIVMiUnVO58JgzxdBVtUsmqqDuBpvdUglQ68rZ8lsgFFO SiKR6GH8UZWVu3DTdT4b0ZTQTRMaSpd/841t0= MIME-Version: 1.0 Received: by 10.216.161.145 with SMTP id w17mr1026947wek.82.1289447995240; Wed, 10 Nov 2010 19:59:55 -0800 (PST) Sender: jianzhou.zh@gmail.com Received: by 10.216.239.132 with HTTP; Wed, 10 Nov 2010 19:59:55 -0800 (PST) Date: Wed, 10 Nov 2010 22:59:55 -0500 X-Google-Sender-Auth: -s-hqVm_H36Ph_3T6LRK8mVbS48 Message-ID: Subject: Average cost of the OCaml GC From: Jianzhou Zhao To: caml-list@yquem.inria.fr Content-Type: text/plain; charset=ISO-8859-1 X-Spam: no; 0.00; ocaml:01 ocaml:01 'self:01 'self:01 zhao:98 57%:98 57%:98 upenn:01 functions:01 functions:01 data:02 defined:02 21%:97 21%:97 profiling:04 Hi, 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? Thanks. -- Jianzhou