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 mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by sympa.inria.fr (Postfix) with ESMTPS id AD9257EC41 for ; Wed, 24 Oct 2012 12:33:48 +0200 (CEST) Received-SPF: None (mail1-smtp-roc.national.inria.fr: no sender authenticity information available from domain of john@coherentgraphics.co.uk) identity=pra; client-ip=188.64.186.31; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="john@coherentgraphics.co.uk"; x-sender="john@coherentgraphics.co.uk"; x-conformance=sidf_compatible Received-SPF: None (mail1-smtp-roc.national.inria.fr: no sender authenticity information available from domain of john@coherentgraphics.co.uk) identity=mailfrom; client-ip=188.64.186.31; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="john@coherentgraphics.co.uk"; x-sender="john@coherentgraphics.co.uk"; x-conformance=sidf_compatible Received-SPF: None (mail1-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@bluemoon3.ukhost4u.com) identity=helo; client-ip=188.64.186.31; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="john@coherentgraphics.co.uk"; x-sender="postmaster@bluemoon3.ukhost4u.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvQBADjDh1C8QLofgWdsb2JhbABEwXwjAQEWJieCHgEBBAE4QAEFCwsHEQkTAw8JAwIBAgFFBg6IAwq7F5JLA6kc X-IronPort-AV: E=Sophos;i="4.80,639,1344204000"; d="scan'208";a="178705210" Received: from bluemoon3.ukhost4u.com ([188.64.186.31]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 24 Oct 2012 12:33:48 +0200 Received: from 78-105-203-81.zone3.bethere.co.uk ([78.105.203.81]:61879 helo=feast.lan) by bluemoon3.ukhost4u.com with esmtpa (Exim 4.80) (envelope-from ) id 1TQyCF-0004be-VG; Wed, 24 Oct 2012 11:28:24 +0100 Message-ID: <5087C409.3030203@coherentgraphics.co.uk> Date: Wed, 24 Oct 2012 11:33:45 +0100 From: John Whitington User-Agent: Postbox 3.0.5 (Macintosh/20120826) MIME-Version: 1.0 To: David MENTRE CC: caml users References: In-Reply-To: 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 - bluemoon3.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-Source: X-Source-Args: X-Source-Dir: Subject: Re: [Caml-list] Behaviour of an OCaml program: any possible GC improvement? Hi David, David MENTRE wrote: > Hello, > > I'm using OCaml 3.11.2 on Linux (Debian Squeeze 6.0) x86_64 platform. > > I have a program that exhibits the following gprof profile. A lot of > time is spent in the GC (more than 56 %). Is there anything I can do > with respect to the GC? Otherwise, this program is a typical symbolic > manipulation program, handling trees made of Sum types and small lists > of them (1 to 3 elements). Can you supply the section under "caml_call_gc"? For example: > 0.00 0.03 1/4988 camlPdfutil__fun_2922 [136] > 0.00 0.03 1/4988 camlPdfutil__takewhile_reverse_inner_1655 [133] > 0.00 0.03 1/4988 camlPdfutil__ilist_1873 [135] > 0.00 0.03 1/4988 camlPdf__x1_1414 [130] > 0.00 0.03 1/4988 camlPdfread__lex_object_at_1344 [132] > 0.00 0.03 1/4988 camlPdfread__process_parse_dictionary_1440 [103] > 0.00 0.03 1/4988 camlPdfread__parse_dictionary_1451 [97] > 0.00 0.03 1/4988 camlPdfread__parse_to_tree_1473 [131] > 0.00 0.03 1/4988 camlHashtbl__insert_bucket_1068 [129] > 0.00 0.07 2/4988 camlPdfwrite__fun_1642 [110] > 0.00 0.07 2/4988 camlPdfread__mkpairs_1442 [112] > 0.00 0.07 2/4988 camlPdfread__fun_2689 [111] > 0.00 0.10 3/4988 camlPdfread__lex_name_1217 [92] > 0.00 0.14 4/4988 camlPdf__fun_1934 [98] > 0.00 0.14 4/4988 camlHashtbl__replace_1112 [96] > 0.00 1.93 56/4988 camlPdfread__lex_string_1230 [32] > 0.00 2.93 85/4988 camlPdfwrite__strings_of_pdf_1131 [24] > 0.00 3.79 110/4988 camlPdfread__lex_number_1211 [28] > 0.00 5.10 148/4988 camlPdfgenlex__lex_item_1109 [45] > 0.00 8.86 257/4988 camlHashtbl__mem_1122 [42] > 0.00 13.24 384/4988 camlPdfread__parse_array_1452 [35] > 0.00 13.34 387/4988 camlList__rmap_f_1070 [34] > 0.00 31.34 909/4988 camlPdfread__parse_R_inner_1422 [26] > 0.00 40.23 1167/4988 camlList__rev_append_1051 [23] > 0.00 50.30 1459/4988 camlPdfread__lex_object_at_1352 [21] > [7] 65.5 0.00 171.97 4988 caml_call_gc [7] > 0.00 171.97 4988/4988 caml_garbage_collection [8] This is usually a good starting point. Thanks, -- John Whitington Director, Coherent Graphics Ltd http://www.coherentpdf.com/