caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: John Whitington <john@coherentgraphics.co.uk>
To: Francois Berenger <berenger@riken.jp>
Cc: OCaml Mailing List <caml-list@inria.fr>
Subject: Re: [Caml-list] an OCaml program profile
Date: Fri, 06 Sep 2013 09:28:43 +0100	[thread overview]
Message-ID: <5229923B.6090404@coherentgraphics.co.uk> (raw)
In-Reply-To: <52293459.9060707@riken.jp>

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/


  parent reply	other threads:[~2013-09-06  8:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-06  1:48 Francois Berenger
2013-09-06  8:14 ` Kakadu
2013-09-06  8:28 ` John Whitington [this message]
2013-09-06  8:49   ` Gabriel Scherer
2013-09-06  9:26     ` Francois Berenger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5229923B.6090404@coherentgraphics.co.uk \
    --to=john@coherentgraphics.co.uk \
    --cc=berenger@riken.jp \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).