From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 8CEBBBBAF for ; Thu, 24 Jul 2008 18:31:58 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhYCAF5LiEiAKgEfiGdsb2JhbACSVAEBAQ8gnjY X-IronPort-AV: E=Sophos;i="4.31,247,1215381600"; d="scan'208";a="15426526" Received: from mail.cs.rice.edu ([128.42.1.31]) by mail3-smtp-sop.national.inria.fr with ESMTP; 24 Jul 2008 18:31:57 +0200 Received: from mail.cs.rice.edu (localhost.localdomain [127.0.0.1]) by mail.cs.rice.edu (Postfix) with ESMTP id 065FD2C2AD0 for ; Thu, 24 Jul 2008 11:31:57 -0500 (CDT) X-Virus-Scanned: by amavis-2.4.0 at mail.cs.rice.edu Received: from mail.cs.rice.edu ([127.0.0.1]) by mail.cs.rice.edu (mail.cs.rice.edu [127.0.0.1]) (amavisd-new, port 10024) with LMTP id uYt5rAAPfdiD for ; Thu, 24 Jul 2008 11:31:56 -0500 (CDT) Received: from [10.121.20.231] (unknown [10.121.20.231]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.cs.rice.edu (Postfix) with ESMTP id 5E0E52C2A91 for ; Thu, 24 Jul 2008 11:31:56 -0500 (CDT) Message-ID: <4888AE76.2030204@rice.edu> Date: Thu, 24 Jul 2008 11:31:50 -0500 From: Raj Bandyopadhyay User-Agent: Thunderbird 2.0.0.14 (X11/20080502) MIME-Version: 1.0 To: caml-list@yquem.inria.fr Subject: Array copying in OCaml Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; ocaml:01 ocaml:01 arrays:01 blit:01 semantics:01 functions:01 seems:03 library:03 raj:05 raj:05 trick:06 haven't:09 rice:12 kind:13 using:15 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 much, because the program semantics seems to demand it. Thanks Raj