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=UNPARSEABLE_RELAY autolearn=disabled version=3.1.3 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 92DDBBC0A for ; Tue, 2 Jan 2007 08:47:30 +0100 (CET) Received: from mailout07.sul.t-online.com (mailout07.sul.t-online.com [194.25.134.83]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l027lUfj020318 for ; Tue, 2 Jan 2007 08:47:30 +0100 Received: from fwd31.aul.t-online.de by mailout07.sul.t-online.com with smtp id 1H1eMo-0004Pa-00; Tue, 02 Jan 2007 08:47:26 +0100 Received: from lauter.olsbruecken.de (Vsd-igZZYeEJy4Pp++Er7K0LBszWu+-wQL6laGsmQ-tn3w9F8ytPs6@[84.166.251.158]) by fwd31.sul.t-online.de with esmtp id 1H1eMc-17uGsS0; Tue, 2 Jan 2007 08:47:14 +0100 Received: by lauter.olsbruecken.de (Postfix, from userid 1000) id 60C6D10082F58; Tue, 2 Jan 2007 08:47:14 +0100 (CET) To: skaller Cc: Erik de Castro Lopo , caml-list@yquem.inria.fr, matthieu.dubuget@laposte.net Subject: Re: [Caml-list] ANNOUNCE : libsndfile-ocaml alpha References: <20061222155407.ebe6c272.mle+ocaml@mega-nerd.com> <45923DC2.9000504@ujf-grenoble.fr> <20061227211046.656615d0.mle+ocaml@mega-nerd.com> <20061231080756.66e89d6c.mle+ocaml@mega-nerd.com> <1167535885.27287.66.camel@rosella.wigram> <20061231152305.694fd3e9.mle+ocaml@mega-nerd.com> <20061231110831.GA21198@furbychan.cocan.org> <20070101095114.911ca90d.mle+ocaml@mega-nerd.com> <4599205A.7050802@laposte.net> <20070102065845.c6558b18.mle+ocaml@mega-nerd.com> <1167699073.13679.15.camel@rosella.wigram> From: c-bauer-olsbruecken@t-online.de (Christoph Bauer) Date: Tue, 02 Jan 2007 08:47:14 +0100 In-Reply-To: <1167699073.13679.15.camel@rosella.wigram> (skaller@users.sourceforge.net's message of "Tue\, 02 Jan 2007 11\:51\:13 +1100") Message-ID: <87hcv96fb1.fsf@elefant.olsbruecken.local> User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.91 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-ID: Vsd-igZZYeEJy4Pp++Er7K0LBszWu+-wQL6laGsmQ-tn3w9F8ytPs6 X-TOI-MSGID: ab284a8c-5e0f-4041-a840-f7236f3c9cde X-Miltered: at concorde with ID 459A0E12.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ocaml:01 bigarrays:01 sourceforge:01 wrote:01 writes:01 caml-list:01 measurements:01 bytes:03 swap:03 christoph:04 christoph:04 erik:04 tue:06 700:93 space:07 skaller writes: > On Tue, 2007-01-02 at 06:58 +1100, Erik de Castro Lopo wrote: >> That file >> is: >> >> 96000 * 60 * 60 * 8 * 4 bytes => >> 11059.200 Mbytes => >> 11.059 Gbytes >> >> Nobody is going to load the whole of that file into memory at once. > > Why not? That's tiny compared to available address space on a 64 > bit machine, and personal computers have heaps > of free address space. I had to deal with big files and OCaml too and Erik's approach sound good to me. On 64 bit machines you may mmap huge files, but you can't on 32-bit machines. I run in troubles with files > 700MB. Maybe you could mmap smaller blocks, but this isn't possible with the current implementation of bigarrays mmap (since you need to mmap with an offset). Furthermore mmap is a bit different on different operation system. Measurements show that mmap doesn't mean a big (or any) speed up. For the OS the advantage is, that no swap space needs to be reservered. Christoph Bauer