caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Shivkumar Chandrasekaran <shiv@ece.ucsb.edu>
To: caml-list@inria.fr
Subject: Re: [Caml-list] Slow GC problem
Date: Tue, 8 Apr 2003 16:03:05 -0700	[thread overview]
Message-ID: <41B8A2FD-6A16-11D7-AEED-000393942C76@ece.ucsb.edu> (raw)
In-Reply-To: <DA1B7136-69AC-11D7-B7DE-0003930FCE12@inria.fr>

This seems to be confirmed by some modifications I did to the code. I 
was able to reduce a whole lot of temporary bigarray allocations and 
got a 30% speed improvement. However any further reduction of bigarray 
creation will require a major "add-on" modification to my entire 
library design, or, memory re-use hacks all over the place. So I would 
like to be reasonably sure that this is worth-while before I proceed.

On Tuesday, April 8, 2003, at 03:28 AM, Damien Doligez wrote:

> On Monday, April 7, 2003, at 07:53 PM, Shivkumar Chandrasekaran wrote:
>
>> Pursuing my earlier enquiry: I noticed that module Bigarray allocated 
>> its arrays using "malloc" rather than on the ocaml heap. My problem 
>> allocates a lot (say 100,000) bigarrays of rather small size (say 30 
>> x 30). Can this potentially increase the cost of gc? (I have this 
>> mental picture of the ocaml heap fragmented by these immovable 
>> malloc'd bigarrays.) Any help will be appreciated. Thanks,
>
> It doesn't matter.  The ocaml heap is allocated in big chunks from 
> malloc,
> and other malloc blocks cannot interfere with its fragmentation.
>
> If your program is allocating lots of temporary bigarrays and leaves 
> them
> to be collected by the GC, then I would say it's using bigarrays in an
> inefficient way.  Bigarrays are mostly designed to be long-lived 
> objects.
> If you can find a way to re-use your bigarrays instead of allocating 
> new
> ones, you should get better performance.
>
> -- Damien
>
> -------------------
> To unsubscribe, mail caml-list-request@inria.fr Archives: 
> http://caml.inria.fr
> Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: 
> http://caml.inria.fr/FAQ/
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
>
--shiv--

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


  reply	other threads:[~2003-04-08 23:03 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-04 19:40 Shivkumar Chandrasekaran
2003-04-03 21:07 ` Christophe Raffalli
2003-04-07 17:53 ` Shivkumar Chandrasekaran
2003-04-07 19:08   ` Chris Hecker
2003-04-08  7:15     ` David Monniaux
2003-04-08 10:28   ` Damien Doligez
2003-04-08 23:03     ` Shivkumar Chandrasekaran [this message]
2003-04-08 10:23 ` Damien Doligez
2003-04-10 21:21   ` Shivkumar Chandrasekaran
2003-04-10 21:51     ` Brian Hurt
2003-04-11  7:10     ` Chris Hecker
2003-04-11  7:58       ` Christophe Raffalli
2003-04-11 16:35         ` Shivkumar Chandrasekaran
2003-04-14 16:37 Shivkumar Chandrasekaran
2003-10-23  8:17 Chris Hecker

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=41B8A2FD-6A16-11D7-AEED-000393942C76@ece.ucsb.edu \
    --to=shiv@ece.ucsb.edu \
    --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).