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 6766A820A1 for ; Fri, 6 Sep 2013 03:48:22 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of berenger@riken.jp) identity=pra; client-ip=134.160.33.161; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="berenger@riken.jp"; x-sender="berenger@riken.jp"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of berenger@riken.jp designates 134.160.33.161 as permitted sender) identity=mailfrom; client-ip=134.160.33.161; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="berenger@riken.jp"; x-sender="berenger@riken.jp"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of postmaster@postman.riken.jp designates 134.160.33.161 as permitted sender) identity=helo; client-ip=134.160.33.161; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="berenger@riken.jp"; x-sender="postmaster@postman.riken.jp"; x-conformance=sidf_compatible; x-record-type="v=spf1" X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AnABADEzKVKGoCGhnGdsb2JhbABbwmiEMA4BAQEBAQgLCQkUKIJjQD0WGAMCAQIBSw0IAQGHfpoQoHCUBAOJM45ChiyOaQ X-IPAS-Result: AnABADEzKVKGoCGhnGdsb2JhbABbwmiEMA4BAQEBAQgLCQkUKIJjQD0WGAMCAQIBSw0IAQGHfpoQoHCUBAOJM45ChiyOaQ X-IronPort-AV: E=Sophos;i="4.90,850,1371074400"; d="scan'208";a="31707678" Received: from postman1.riken.jp (HELO postman.riken.jp) ([134.160.33.161]) by mail2-smtp-roc.national.inria.fr with ESMTP; 06 Sep 2013 03:48:20 +0200 Received: from postman.riken.jp (postman1.riken.jp [127.0.0.1]) by postman.riken.jp (Postfix) with SMTP id D7DD82588001 for ; Fri, 6 Sep 2013 10:48:17 +0900 (JST) Received: from [172.27.98.103] (rikad98.riken.jp [134.160.214.98]) by postman.riken.jp (Postfix) with ESMTPA id 9F28132A0085 for ; Fri, 6 Sep 2013 10:48:17 +0900 (JST) Message-ID: <52293459.9060707@riken.jp> Date: Fri, 06 Sep 2013 10:48:09 +0900 From: Francois Berenger User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130623 Thunderbird/17.0.7 MIME-Version: 1.0 To: OCaml Mailing List Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-PMX-Version: 6.0.0.2142326, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2013.9.6.14214 Subject: [Caml-list] an OCaml program profile 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.