Re: [Caml-list] Array copying in OCaml

2008-07-29 Thread Michel Mauny
Having a look at the comment Hard bootstrap how-to in the toplevel Makefile of the OCaml distribution may help. -- MM Raj Bandyopadhyay écrit/writes [07/28/2008 07:34 PM] : Thanks Richard! I added my C code to array.c (in the development version which I got from CVS), and added an external

Re: [Caml-list] Array copying in OCaml

2008-07-28 Thread Raj Bandyopadhyay
Thanks Richard! I added my C code to array.c (in the development version which I got from CVS), and added an external declaration in array.ml. However, I now get the following compiler error: File _none_, line 1, characters 0-1: Error: Error while linking boot/stdlib.cma(Array): The external

Re: [Caml-list] Array copying in OCaml

2008-07-28 Thread Richard Jones
On Mon, Jul 28, 2008 at 12:34:17PM -0500, Raj Bandyopadhyay wrote: I added my C code to array.c (in the development version which I got from CVS), and added an external declaration in array.ml. However, I now get the following compiler error: It's hard to say. Do you have a suggested patch

Re: [Caml-list] Array copying in OCaml

2008-07-27 Thread Raj Bandyopadhyay
As a follow up to this: I got a 3x performance improvement by writing my own version of the Array.sub function in C, patterned after the caml_make_vect function in the OCaml compiler. I don't think that C is the main reason for the improvement, it's more fundamental: 1) The OCaml library

[Caml-list] Array copying in OCaml

2008-07-24 Thread Raj Bandyopadhyay
Hi 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

Re: [Caml-list] Array copying in OCaml

2008-07-24 Thread Dr. Thomas Fischbacher
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

Re: [Caml-list] Array copying in OCaml

2008-07-24 Thread Christophe TROESTLER
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

Re: [Caml-list] Array copying in OCaml

2008-07-24 Thread Adrien
You can compile with the -unsafe flag. If you're using arrays a lot, it can easily speed your program by 50%. If your program is array based, the speedup can be even more important. Don't assume it could magically make your program behave in a weird way. When you're trying to access an element