Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Array copying in OCaml
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2008-07-24 (17:25)
From: Christophe TROESTLER <Christophe.Troestler+ocaml@u...>
Subject: Re: [Caml-list] Array copying in OCaml
On Thu, 24 Jul 2008 11:31:50 -0500, Raj Bandyopadhyay wrote:
> I have an application which copies a lot of (small) OCaml arrays
> using the Array library (Array.sub and Array.blit) functions. This
> is turning out to be extremely expensive.
> Is there any general way/trick to reduce the cost of this kind of
> operation? I haven't found a way not to copy as much, because the
> program semantics seems to demand it.

That all depends on the set of operations you want to support on these
arrays.  For example, if all you want is access, concatenation and
slices, then an approach like the Rope library [1] may be envisioned.
What is the problem you want to solve?