From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id BAA30582; Wed, 9 Apr 2003 01:03:40 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id BAA30575 for ; Wed, 9 Apr 2003 01:03:38 +0200 (MET DST) Received: from xanadu.ece.ucsb.edu (xanadu.ece.ucsb.edu [128.111.56.51]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h38N3a907514 for ; Wed, 9 Apr 2003 01:03:37 +0200 (MET DST) Received: from ece.ucsb.edu (gimli.ece.ucsb.edu [128.111.56.252]) by xanadu.ece.ucsb.edu (8.11.6+Sun/8.11.6) with ESMTP id h38N3WS10175 for ; Tue, 8 Apr 2003 16:03:32 -0700 (PDT) Date: Tue, 8 Apr 2003 16:03:05 -0700 Subject: Re: [Caml-list] Slow GC problem Content-Type: text/plain; charset=US-ASCII; format=flowed Mime-Version: 1.0 (Apple Message framework v551) From: Shivkumar Chandrasekaran To: caml-list@inria.fr Content-Transfer-Encoding: 7bit In-Reply-To: Message-Id: <41B8A2FD-6A16-11D7-AEED-000393942C76@ece.ucsb.edu> X-Mailer: Apple Mail (2.551) X-Spam: no; 0.00; shivkumar:01 shiv:01 caml-list:01 allocations:01 add-on:01 re-use:01 hacks:01 damien:01 enquiry:99 malloc:01 allocates:01 bigarrays:01 chunks:01 interfere:01 allocating:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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