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 mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id BB6B5820A1 for ; Fri, 6 Sep 2013 10:14:14 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of kakadu.hafanana@gmail.com) identity=pra; client-ip=209.85.220.43; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="kakadu.hafanana@gmail.com"; x-sender="kakadu.hafanana@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of kakadu.hafanana@gmail.com designates 209.85.220.43 as permitted sender) identity=mailfrom; client-ip=209.85.220.43; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="kakadu.hafanana@gmail.com"; x-sender="kakadu.hafanana@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-pa0-f43.google.com) identity=helo; client-ip=209.85.220.43; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="kakadu.hafanana@gmail.com"; x-sender="postmaster@mail-pa0-f43.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ao8BAFiOKVLRVdwrm2dsb2JhbABbgzxRrw6SRIEaCBYOAQEBAQEGCwsJFCiCJAEBBUABGxILAQMMBgULDQ0hIgERAQUBChIGExIJh1QBAw8MnTqMUIMFhCUKGScDCmSIMwEFDI9mB4QdA4kvhXyISoEvjk4YKYRNNw X-IPAS-Result: Ao8BAFiOKVLRVdwrm2dsb2JhbABbgzxRrw6SRIEaCBYOAQEBAQEGCwsJFCiCJAEBBUABGxILAQMMBgULDQ0hIgERAQUBChIGExIJh1QBAw8MnTqMUIMFhCUKGScDCmSIMwEFDI9mB4QdA4kvhXyISoEvjk4YKYRNNw X-IronPort-AV: E=Sophos;i="4.90,852,1371074400"; d="scan'208";a="25922149" Received: from mail-pa0-f43.google.com ([209.85.220.43]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 06 Sep 2013 10:14:13 +0200 Received: by mail-pa0-f43.google.com with SMTP id hz10so3019853pad.30 for ; Fri, 06 Sep 2013 01:14:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=m88aj242YXkT2eZv5A64qaZdjVzbWfdpYwy/U9a3PmE=; b=O/xtG78xlps6WAelYYMXcQTTSwUFTbFexdoPtT/5m6WeZYOSxbiQHAmLPY7j3Z0wid K7TtUxd0DForfiT2QJHv7Nl73Q+DReMXwNAqOSfiJTbyRZ/be8ok+fdX0dppT8UMRO3j WF/gOwOo2rwin07wQDAoOr+NXOGXdCFoDevAv6y/ruGcOHkf7bmxq00BBLmOE1UBXGUX N+wxNjVSfBJqdhiFD3tE32Dv05jnjcWDfnYk5e/k2cgan61YrYabXC3TLmkIqYhBAb7D RnSp6TrF9tVGSpMWzaS2bphCYW0R6YuV0vgh+lZ6YBGeqa0MS8GaHNqBi7EymH58cF9R crYw== MIME-Version: 1.0 X-Received: by 10.67.30.225 with SMTP id kh1mr2521197pad.148.1378455252003; Fri, 06 Sep 2013 01:14:12 -0700 (PDT) Received: by 10.70.50.71 with HTTP; Fri, 6 Sep 2013 01:14:11 -0700 (PDT) In-Reply-To: <52293459.9060707@riken.jp> References: <52293459.9060707@riken.jp> Date: Fri, 6 Sep 2013 12:14:11 +0400 Message-ID: From: Kakadu To: Francois Berenger Cc: OCaml Mailing List Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [Caml-list] an OCaml program profile I have had the same issue with my parser combinators this summer. OCamlLex based lexer was allocating a lot during lexing phase nad that's why my heap was consist of many small free block which couldn't be used for new allocations. Increasing minor heap size fas a partial solution. Running Gc.compact () manually was a main solution. Happy hacking, Kakadu On Fri, Sep 6, 2013 at 5:48 AM, 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? > > Would the OPAM switch 4.00.1+alloc-profiling (support allocation profiling > on x86_64) would allow me to find the culprit function? > > If yes, how to use it? > > Thanks a lot, > Francois. > > -- > Caml-list mailing list. Subscription management and archives: > https://sympa.inria.fr/sympa/arc/caml-list > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs