Return-Path: <tiff-bounces@lists.maptools.org>
X-Original-To: info@awaresystems.be
Delivered-To: info@awaresystems.be
Received: from mx-r.b-one.net (mx-r.one.com [91.198.169.249])
	by mail9.b-one.net (Postfix) with ESMTP id D0996400B7B
	for <info@awaresystems.be>; Mon, 10 May 2010 18:19:11 +0200 (CEST)
Received: by mx-r.b-one.net (Postfix, from userid 106)
	id AE4BFA84092; Mon, 10 May 2010 18:19:11 +0200 (CEST)
X-Virus-Scanned: by one.com
X-Spam-Score: 0
X-Spam-Level: 
X-Spam-Status: No, score=0 tagged_above=0 required=4 tests=[none]
X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4
Received: from lists.maptools.org (lists.maptools.org [65.39.174.144]) by
 mx-r.b-one.net (Postfix) with ESMTP id 57DAB902342 for
 <info@awaresystems.be>; Mon, 10 May 2010 18:19:06 +0200 (CEST)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by
 lists.maptools.org (Postfix) with ESMTP id 14BB51D3A4CA3; Mon, 10 May 2010
 11:18:27 -0500 (EST)
Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com
 [209.85.219.226]) by lists.maptools.org (Postfix) with ESMTP id AD2411D3545E8
 for <tiff@lists.maptools.org>; Mon, 10 May 2010 11:17:16 -0500 (EST)
Received: by ewy26 with SMTP id 26so746391ewy.3 for
 <tiff@lists.maptools.org>; Mon, 10 May 2010 09:17:15 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.103.86.32 with SMTP id o32mr2413323mul.99.1273508235072; Mon,
 10 May 2010 09:17:15 -0700 (PDT)
Received: by 10.103.170.20 with HTTP; Mon, 10 May 2010 09:17:15 -0700 (PDT)
In-Reply-To: <alpine.GSO.2.01.1005101044410.12887@freddy.simplesystems.org>
References: <4BE7EF95.9690.0040.1@geo.ku.dk> <4BE809BE.3030500@sidefx.com>
 <4BE842A2.9690.0040.1@geo.ku.dk>
 <alpine.GSO.2.01.1005101044410.12887@freddy.simplesystems.org>
Date: Mon, 10 May 2010 12:17:15 -0400
Message-ID: <AANLkTik4bWrE1BjZaZ43gfUjvL7UoLSLH_TWsMNsSDpP@mail.gmail.com>
From: Olivier Paquet <olivier.paquet@gmail.com>
To: Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
Cc: Tiff List <tiff@lists.maptools.org>
Subject: Re: [Tiff] Increasing the number of files loadable through libtiff
X-BeenThere: tiff@lists.maptools.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: TIFF and libtiff discussion <tiff.lists.maptools.org>
List-Unsubscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
 <mailto:tiff-request@lists.maptools.org?subject=unsubscribe>
List-Archive: <http://lists.maptools.org/mailman/private/tiff>
List-Post: <mailto:tiff@lists.maptools.org>
List-Help: <mailto:tiff-request@lists.maptools.org?subject=help>
List-Subscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
 <mailto:tiff-request@lists.maptools.org?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: tiff-bounces@lists.maptools.org
Errors-To: tiff-bounces@lists.maptools.org

On Mon, May 10, 2010 at 11:51 AM, Bob Friesenhahn
<bfriesen@simple.dallas.tx.us> wrote:
> On Mon, 10 May 2010, Simon R. Proud wrote:
>>
>> Out of interest: Is there any reason why memory mapping is enabled
>> by default? Enabling it causes problems like the ones I have been
>> having and, at least in my case, offers no speed advantage.
>
> Libtiff seems to do a lot of file seeking and small reads because of
> the TIFF directory structures and organization. =A0The memory mapping

From a quick glance at the code, reading a directory looks like a
single seek and 3 reads. Reading a tile/strip looks like one seek and
one read. It shouldn't be too bad for most files.

> tends to help hide this because it provides a caching effect. =A0It also
> helps quite a lot if the input file is opened and read several times
> without any other intermediate memory-hogging process which might lose
> the already cached data.

You should get the same caching benefit with ordinary reads on most
operating systems.

> Regardless, my own application defaults to not using memory mapping
> for input files.

Same for ours. It might be that there's a problem with the default
value ;-) On the other hand, one could argue that people will never
enable a feature they don't know about but will do what is needed to
disable one which breaks their application. So leaving it on is best
for everyone but the developers. At least running out of address space
should no longer be an issue on 64-bit systems.

Olivier
_______________________________________________
Tiff mailing list: Tiff@lists.maptools.org
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/
