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 mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by sympa.inria.fr (Postfix) with ESMTPS id C82267EC41 for ; Wed, 24 Oct 2012 12:09:18 +0200 (CEST) Received-SPF: None (mail4-smtp-sop.national.inria.fr: no sender authenticity information available from domain of david.mentre@gmail.com) identity=pra; client-ip=209.85.210.182; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="david.mentre@gmail.com"; x-sender="david.mentre@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail4-smtp-sop.national.inria.fr: domain of david.mentre@gmail.com designates 209.85.210.182 as permitted sender) identity=mailfrom; client-ip=209.85.210.182; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="david.mentre@gmail.com"; x-sender="david.mentre@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail4-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-ia0-f182.google.com) identity=helo; client-ip=209.85.210.182; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="david.mentre@gmail.com"; x-sender="postmaster@mail-ia0-f182.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av8CAEG9h1DRVdK2m2dsb2JhbABEwHIDfwgjAQEBAQEICQsdJ4I3AiwBOQMNBRBaAxIBBQEiGxqHUAMPmXKCZwkDjx6FECcNiU4BBQyMNYYKA40riEiOWBYpgViCOw X-IronPort-AV: E=Sophos;i="4.80,639,1344204000"; d="scan'208";a="160216278" Received: from mail-ia0-f182.google.com ([209.85.210.182]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 24 Oct 2012 12:09:17 +0200 Received: by mail-ia0-f182.google.com with SMTP id k10so476866iag.27 for ; Wed, 24 Oct 2012 03:09:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:from:date:x-google-sender-auth:message-id :subject:to:content-type; bh=jPFFxyczd25/6DwZL4DNh4uSbs7sKNSfQGJA09bqvV8=; b=oCGcGKtTKXan/8wvFO13pfR9r9wWC63NcbaMZZrMW3VdgeHRcraiEs6f8q/p8GTZE9 Ynd24jh3rqr8IAQgm8iTtupp+Q5Fym+xzT7Jp6byvoh3FF6a1IA1ORSmZXCv1LIOo+Fl Zj/GSojIbirN7FKXmF/+yq3o6ViYdh3aJ6hWR8H6U7zGVd9B8uaxfjzLC9B73uQyDMf0 TcAAwYQq4FJ7iOxrG++hXeWEqyLQY2HW1rHQ5jGCt9fpC6ghlMHDjeyAuVJfuK/0qVD9 cEObK8BWBmgHY1GqYe+S4luUuzv7IoapJ3FM7hrNJ7XPpQe2bLUw9xOLePTlS0IssUye 2DWA== Received: by 10.42.104.208 with SMTP id s16mr3581643ico.15.1351073356380; Wed, 24 Oct 2012 03:09:16 -0700 (PDT) MIME-Version: 1.0 Sender: david.mentre@gmail.com Received: by 10.64.147.97 with HTTP; Wed, 24 Oct 2012 03:08:46 -0700 (PDT) From: David MENTRE Date: Wed, 24 Oct 2012 12:08:46 +0200 X-Google-Sender-Auth: zwQVnOgKG57g-6JV3Msu2A8m6ls Message-ID: To: caml users Content-Type: text/plain; charset=ISO-8859-1 Subject: [Caml-list] Behaviour of an OCaml program: any possible GC improvement? 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). """ Each sample counts as 0.01 seconds. % cumulative self self total time seconds seconds calls s/call s/call name 35.95 190.95 190.95 279963 0.00 0.00 mark_slice 19.63 295.22 104.27 477027 0.00 0.00 sweep_slice 9.79 347.23 52.01 88113 0.00 0.00 camlMap__map_181 6.72 382.95 35.72 3712176346 0.00 0.00 caml_page_table_lookup 6.23 416.06 33.11 756990 0.00 0.00 caml_oldify_mopup 4.60 440.47 24.41 3919716797 0.00 0.00 caml_fl_allocate 3.92 461.31 20.84 3925371187 0.00 0.00 caml_oldify_one 3.06 477.56 16.25 4125151093 0.00 0.00 caml_fl_merge_block 2.56 491.15 13.59 3919716670 0.00 0.00 caml_alloc_shr 1.44 498.82 7.67 3882908903 0.00 0.00 camlData_typing__apply_269 1.31 505.78 6.96 3919716670 0.00 0.00 allocate_block 1.14 511.81 6.03 1 6.03 6.03 caml_realloc_ref_table 0.69 515.45 3.64 3897784282 0.00 0.00 caml_curry2_1 0.43 517.76 2.31 caml_set_allocation_policy 0.41 519.96 2.20 1513980 0.00 0.00 clear_table 0.40 522.09 2.13 caml_fl_reset 0.34 523.90 1.81 74 0.02 0.02 camlMap__iter_175 0.23 525.11 1.21 7109929 0.00 0.00 caml_gc_message 0.19 526.14 1.04 127 0.01 0.01 caml_add_to_heap 0.17 527.04 0.89 756990 0.00 0.00 caml_oldify_local_roots 0.11 527.61 0.57 8826439 0.00 0.00 caml_curry2 0.05 527.90 0.29 camlData_typing__print_vset_177 0.03 528.07 0.17 5946696 0.00 0.00 camlFormat__kpr_643 0.03 528.22 0.15 10355866 0.00 0.00 camlFormat__doprn_654 0.03 528.36 0.14 10179867 0.00 0.00 camlFormat__advance_loop_299 0.02 528.47 0.11 95566619 0.00 0.00 caml_modify 0.02 528.57 0.11 26632458 0.00 0.00 camlFormat__peek_queue_214 0.02 528.68 0.11 16452591 0.00 0.00 camlFormat__format_pp_token_255 0.02 528.78 0.10 15479410 0.00 0.00 caml_putblock 0.02 528.88 0.10 15457716 0.00 0.00 camlPervasives__output_218 0.02 528.96 0.08 caml_c_call [ ... snipped all functions <= 0.01 % ... ] Best regards, david