Return-Path: <awaresystems.be+caf_=filtered=awaresystems.be@gmail.com>
Delivered-To: filtered@awaresystems.be
Received: from mx1.public.one.com ([10.246.18.21])
	by mail6.local.one.com (Dovecot) with LMTP id 9IbxDi5PrFiIhwEAsyOMew
	for <filtered@awaresystems.be>; Tue, 21 Feb 2017 15:18:55 +0000
X-HalOne-ID: 0e7740db-f849-11e6-98ef-b82a72d859f1
Received: from mail-oi0-f48.google.com (unknown [209.85.218.48])
	by mx1.public.one.com (Halon) with ESMTPS
	id 0e7740db-f849-11e6-98ef-b82a72d859f1;
	Tue, 21 Feb 2017 15:18:54 +0000 (UTC)
Received: by mail-oi0-f48.google.com with SMTP id 2so29847816oif.0
        for <filtered@awaresystems.be>; Tue, 21 Feb 2017 07:18:54 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-original-authentication-results:x-gm-message-state:delivered-to
         :mime-version:in-reply-to:references:from:date:message-id:to:cc
         :subject:precedence:list-id:list-unsubscribe:list-archive:list-post
         :list-help:list-subscribe:mime-version:sender:errors-to;
        bh=2nJ//icTHITgp97vRJDhU4t5Jn9B1jFVJFzBtPUxIXw=;
        b=NylDmnYnS/uaIw6Wi0HlQLmo2N9YWt8IcukR75hsmT2agQlv+1lHlbqojIvaiEofwh
         rSAM72wWa0vsHo7/aCidszNGtPmsvmsxz5tnfo/2B8uNLiKl4rZJK1zJwLmVB0p3zxR5
         C9lZ2hfEg1pELahLFzrNJU91U9qyoqGBSmI4/PuVEg1RKYPXEpmRWVTfEK5lJDOOyUNQ
         bTFRUJeGRNQdb5AO4rv2bHaSQhToIkcbGNvvCBzqyzPRxIxdrvSbazKz6FVGD3kQHDls
         Xl1bUNKRM5qvl51etmGkHo2pYvKGwWzUgon1Zl1hHt7Ug+V54XdeS8qIZM7XdJYyGsqY
         TeaA==
X-Original-Authentication-Results: mx.google.com;       spf=neutral (google.com: 94.23.4.142 is neither permitted nor denied by best guess record for domain of tiff-bounces@lists.maptools.org) smtp.mailfrom=tiff-bounces@lists.maptools.org;       dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com
X-Gm-Message-State: AMke39lI/KZ/qagtqZh0NJz1eb20fPYGkyrS+A2MNjsSTVkk5+5KIKXxugJXAdgmGSVv59QqcoQZ4MzKzpueU54sRDZrzEE=
X-Received: by 10.202.225.193 with SMTP id y184mr14704564oig.115.1487690333628;
        Tue, 21 Feb 2017 07:18:53 -0800 (PST)
X-Forwarded-To: filtered@awaresystems.be
X-Forwarded-For: awaresystems.be@gmail.com filtered@awaresystems.be
Delivered-To: awaresystems.be@gmail.com
Received: by 10.202.175.14 with SMTP id y14csp464541oie;
        Tue, 21 Feb 2017 07:18:52 -0800 (PST)
X-Received: by 10.28.61.84 with SMTP id k81mr24949213wma.27.1487690332319;
        Tue, 21 Feb 2017 07:18:52 -0800 (PST)
Return-Path: <tiff-bounces@lists.maptools.org>
Received: from lists.maptools.org (ks365428.kimsufi.com. [94.23.4.142])
        by mx.google.com with ESMTP id u133si16824634wmu.53.2017.02.21.07.18.51;
        Tue, 21 Feb 2017 07:18:52 -0800 (PST)
Received-SPF: neutral (google.com: 94.23.4.142 is neither permitted nor denied by best guess record for domain of tiff-bounces@lists.maptools.org) client-ip=94.23.4.142;
Authentication-Results: mx.google.com;
       spf=neutral (google.com: 94.23.4.142 is neither permitted nor denied by best guess record for domain of tiff-bounces@lists.maptools.org) smtp.mailfrom=tiff-bounces@lists.maptools.org;
       dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com
Received: from [10.1.0.241] (localhost.localdomain [127.0.0.1])
	by lists.maptools.org (Postfix) with ESMTP id 3BA5435C02B;
	Tue, 21 Feb 2017 10:17:14 -0500 (EST)
Received: from mail-qk0-f174.google.com (mail-qk0-f174.google.com
	[209.85.220.174])
	by lists.maptools.org (Postfix) with ESMTPS id C413235C029
	for <tiff@lists.maptools.org>; Tue, 21 Feb 2017 10:16:56 -0500 (EST)
Received: by mail-qk0-f174.google.com with SMTP id x71so58763223qkb.3
	for <tiff@lists.maptools.org>; Tue, 21 Feb 2017 07:16:56 -0800 (PST)
X-Received: by 10.55.23.29 with SMTP id i29mr27641633qkh.139.1487690215198;
	Tue, 21 Feb 2017 07:16:55 -0800 (PST)
MIME-Version: 1.0
Received: by 10.12.133.67 with HTTP; Tue, 21 Feb 2017 07:16:54 -0800 (PST)
In-Reply-To: <CAAcuQeZezsQe++YXq4iYZTRkjS_rxTHxdZn3Dn1LM+yzSMRnDQ@mail.gmail.com>
References: <CAHcSuBoRvQ9eA1OTRJ=Cy+aTJbUDCp+kutsQ72RuKNYVuF9Rdg@mail.gmail.com>
	<alpine.GSO.2.20.1702061749190.10840@freddy.simplesystems.org>
	<5899177B.3030108@osa.pri.ee>
	<alpine.GSO.2.20.1702061856090.2297@freddy.simplesystems.org>
	<CAHcSuBpwvcckWgq-csZ1eJfC3uBJVWAgDbUZckDXJKjUbDM_Bg@mail.gmail.com>
	<CAHcSuBqVHmWs8xW7ocA4XUtMzZCgyrr1UxN7MCP1id_AuYynVw@mail.gmail.com>
	<CAAcuQeanLV7_Et3o3GhCr8U4D_FbQLfj49CcVT7JKBEuhpb2Dw@mail.gmail.com>
	<alpine.GSO.2.20.1702071410290.14154@freddy.simplesystems.org>
	<CAHcSuBqs1UvzSTsbF9kZfKqbv-7F5mDQ-Gv=TzegNb-QT4a_5Q@mail.gmail.com>
	<alpine.GSO.2.20.1702130829290.14399@freddy.simplesystems.org>
	<CAAcuQeZezsQe++YXq4iYZTRkjS_rxTHxdZn3Dn1LM+yzSMRnDQ@mail.gmail.com>
From: Dinesh Iyer <dsi.maillist@gmail.com>
Date: Tue, 21 Feb 2017 10:16:54 -0500
Message-ID: <CAHcSuBqKVeyTHng43ZMrXkY+DLyWEQq-+z2Ga5nc3qJw6PAhiw@mail.gmail.com>
To: Olivier Paquet <olivier.paquet@gmail.com>
Cc: TIFF mailing list <tiff@lists.maptools.org>
Subject: Re: [Tiff] Qs about support for more than 2^16 IFDs and writing
	performance
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: multipart/mixed; boundary="===============1736723737=="
Mime-version: 1.0
Sender: tiff-bounces@lists.maptools.org
Errors-To: tiff-bounces@lists.maptools.org

--===============1736723737==
Content-Type: multipart/alternative; boundary=001a114751aed0390d05490bde92

--001a114751aed0390d05490bde92
Content-Type: text/plain; charset=UTF-8

Hi everyone,
I managed to get in touch with the author of the patch. His name is Martin.
He was OK with his work being used in the TIFF library. He also had the
following to say about his patch.

I developed this patch really with only incrementally writing a new file in
mind, I have not considered at all how well this would work with editing
existing files, etc. In that sense I am not sure whether this can easily be
merged into the actual library.

But he is OK with this patch being used as a starting point for any fix
that will work in all scenarios. Please do let me know if you require any
additional information.

Regards,
Dinesh


On Mon, Feb 13, 2017 at 11:22 AM, Olivier Paquet <olivier.paquet@gmail.com>
wrote:

> 2017-02-13 9:35 GMT-05:00 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>:
> >
> > We are still needing a minimal test-case (in portable C code) which
> > exhibits the slow writing problem so that the quality of any solution
> > can be evaluated.
>
> Here's my contribution (slow.c):
>
> #include <tiffio.h>
> #include <stdlib.h>
> #include <stdio.h>
>
> int main( int argc, const char *argv[] )
> {
>        int n = atoi( argv[1] );
>        TIFF* tif = TIFFOpen( "test.tif", "w" );
>        for( int i = 0; i < n; ++i )
>        {
>                TIFFWriteDirectory( tif );
>        }
>        TIFFClose( tif );
>        remove( "test.tif" );
> }
>
> Not a valid TIFF but you did say minimal ;-) It clearly shows bad behavior:
>
> > /usr/bin/gcc slow.c -ltiff -ljpeg -llzma -pthread
> > time ./a.out 1000
> 0.056u 0.203s 0:00.29 86.2%
> > time ./a.out 10000
> 3.563u 21.436s 0:25.05 99.7%
> > time ./a.out 20000
> 14.189u 86.316s 1:40.57 99.9%
>
> Olivier
> _______________________________________________
> Tiff mailing list: Tiff@lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/tiff
> http://www.remotesensing.org/libtiff/
>

--001a114751aed0390d05490bde92
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hi everyone,<div>I managed to get in touch with the author=
 of the patch. His name is Martin. He was OK with his work being used in th=
e TIFF library. He also had the following to say about his patch.</div><div=
><br></div><div><span style=3D"font-size:11pt;font-family:calibri,sans-seri=
f">I developed this patch really with only incrementally
writing a new file in mind, I have not considered at all how well this woul=
d
work with editing existing files, etc. In that sense I am not sure whether =
this
can easily be merged into the actual library.</span><br></div><div><span st=
yle=3D"font-size:11pt;font-family:calibri,sans-serif"><br></span></div><div=
>But he is OK with this patch being used as a starting point for any fix th=
at will work in all scenarios. Please do let me know if you require any add=
itional information.<br></div><div><br></div><div>Regards,</div><div>Dinesh=
</div><div><br></div></div><div class=3D"gmail_extra"><br><div class=3D"gma=
il_quote">On Mon, Feb 13, 2017 at 11:22 AM, Olivier Paquet <span dir=3D"ltr=
">&lt;<a href=3D"mailto:olivier.paquet@gmail.com" target=3D"_blank">olivier=
.paquet@gmail.com</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote=
" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><=
span class=3D"">2017-02-13 9:35 GMT-05:00 Bob Friesenhahn &lt;<a href=3D"ma=
ilto:bfriesen@simple.dallas.tx.us">bfriesen@simple.dallas.tx.us</a>&gt;<wbr=
>:<br>
&gt;<br>
&gt; We are still needing a minimal test-case (in portable C code) which<br=
>
&gt; exhibits the slow writing problem so that the quality of any solution<=
br>
&gt; can be evaluated.<br>
<br>
</span>Here&#39;s my contribution (slow.c):<br>
<br>
#include &lt;tiffio.h&gt;<br>
#include &lt;stdlib.h&gt;<br>
#include &lt;stdio.h&gt;<br>
<br>
int main( int argc, const char *argv[] )<br>
{<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0int n =3D atoi( argv[1] );<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0TIFF* tif =3D TIFFOpen( &quot;test.tif&quot;, &q=
uot;w&quot; );<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0for( int i =3D 0; i &lt; n; ++i )<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0{<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0TIFFWriteDirectory( =
tif );<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0}<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0TIFFClose( tif );<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0remove( &quot;test.tif&quot; );<br>
}<br>
<br>
Not a valid TIFF but you did say minimal ;-) It clearly shows bad behavior:=
<br>
<br>
&gt; /usr/bin/gcc slow.c -ltiff -ljpeg -llzma -pthread<br>
&gt; time ./a.out 1000<br>
0.056u 0.203s 0:00.29 86.2%<br>
&gt; time ./a.out 10000<br>
3.563u 21.436s 0:25.05 99.7%<br>
&gt; time ./a.out 20000<br>
14.189u 86.316s 1:40.57 99.9%<br>
<span class=3D"HOEnZb"><font color=3D"#888888"><br>
Olivier<br>
</font></span><div class=3D"HOEnZb"><div class=3D"h5">_____________________=
_________<wbr>_________________<br>
Tiff mailing list: <a href=3D"mailto:Tiff@lists.maptools.org">Tiff@lists.ma=
ptools.org</a><br>
<a href=3D"http://lists.maptools.org/mailman/listinfo/tiff" rel=3D"noreferr=
er" target=3D"_blank">http://lists.maptools.org/<wbr>mailman/listinfo/tiff<=
/a><br>
<a href=3D"http://www.remotesensing.org/libtiff/" rel=3D"noreferrer" target=
=3D"_blank">http://www.remotesensing.org/<wbr>libtiff/</a><br>
</div></div></blockquote></div><br></div>

--001a114751aed0390d05490bde92--

--===============1736723737==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

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