From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 8E69A820A1 for ; Fri, 6 Sep 2013 10:28:46 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of john@coherentgraphics.co.uk) identity=pra; client-ip=188.64.184.40; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="john@coherentgraphics.co.uk"; x-sender="john@coherentgraphics.co.uk"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of john@coherentgraphics.co.uk) identity=mailfrom; client-ip=188.64.184.40; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="john@coherentgraphics.co.uk"; x-sender="john@coherentgraphics.co.uk"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@bluechip4.ukhost4u.com) identity=helo; client-ip=188.64.184.40; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="john@coherentgraphics.co.uk"; x-sender="postmaster@bluechip4.ukhost4u.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ao4CADqRKVK8QLgoemdsb2JhbABbgzzCI4EiFg4BAQsHDQk8giQBAQU4QAEQCwcRCRMDDwkDAgECAUUGDogLu3+PcgeEHQOsfA X-IPAS-Result: Ao4CADqRKVK8QLgoemdsb2JhbABbgzzCI4EiFg4BAQsHDQk8giQBAQU4QAEQCwcRCRMDDwkDAgECAUUGDogLu3+PcgeEHQOsfA X-IronPort-AV: E=Sophos;i="4.90,852,1371074400"; d="scan'208";a="31746430" Received: from bluechip4.ukhost4u.com ([188.64.184.40]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 06 Sep 2013 10:28:45 +0200 Received: from 78-105-203-81.zone3.bethere.co.uk ([78.105.203.81]:49170 helo=feast.local) by bluechip4.ukhost4u.com with esmtpa (Exim 4.80.1) (envelope-from ) id 1VHrPI-001sus-Nm; Fri, 06 Sep 2013 09:28:44 +0100 Message-ID: <5229923B.6090404@coherentgraphics.co.uk> Date: Fri, 06 Sep 2013 09:28:43 +0100 From: John Whitington User-Agent: Postbox 3.0.8 (Macintosh/20130427) MIME-Version: 1.0 To: Francois Berenger CC: OCaml Mailing List References: <52293459.9060707@riken.jp> In-Reply-To: <52293459.9060707@riken.jp> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bluechip4.ukhost4u.com X-AntiAbuse: Original Domain - inria.fr X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - coherentgraphics.co.uk X-Get-Message-Sender-Via: bluechip4.ukhost4u.com: authenticated_id: john@coherentgraphics.co.uk Subject: Re: [Caml-list] an OCaml program profile Hi, Francois Berenger wrote: > Hello, > > I am running experiments with a program. > I'd like the program to run faster because > it would reduce experiments round-trip. > > Here is the top of the profile: > --- > Flat profile: > > Each sample counts as 0.01 seconds. > % cumulative self self total > time seconds seconds calls s/call s/call name > 58.07 132.13 132.13 161527987 0.00 0.00 caml_fl_allocate > 21.13 180.21 48.08 2339 0.02 0.02 caml_fl_add_blocks > 4.87 191.30 11.09 5497 0.00 0.00 mark_slice > 1.65 195.06 3.76 979591485 0.00 0.00 caml_page_table_lookup > 1.50 198.47 3.41 5620 0.00 0.00 sweep_slice > 1.20 201.21 2.74 186584504 0.00 0.00 caml_oldify_one > 1.04 203.57 2.36 134849325 0.00 0.00 compare_val > 1.02 205.89 2.32 290049921 0.00 0.00 caml_float_compare > 0.80 207.71 1.82 123048730 0.00 0.00 caml_hash > 0.76 209.44 1.73 161525648 0.00 0.00 caml_alloc_shr > --- > > I think the program spends most of its time doing garbage > collection. > > How can I make it go faster? Look further down the profile in the individual numbered sections for each function. The section for "caml_call_gc" usually provides the most useful start. For example, if most calls to caml_call_gc are from List.rev, look at calls to that etc. It's not entirely straightforward, but after a bit of following numbers around the file, you'll get used to it. Thanks, -- John Whitington Director, Coherent Graphics Ltd http://www.coherentpdf.com/