<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Jason,<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas;
color:#1F497D'>Is your program rendering the data to the screen or just processing
it somehow?  As a bench mark for you, I can render nitf files that are 1.8GB
and bigger in one to two seconds on my machine using gdal over a samba network connection
to a linux machine (100MB/sec Ethernet).  The trick is resampling the image on
the fly using rasterio() to fit the screen size.  There is a HUGE performance
difference when you do this. <o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas;
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas;
color:#1F497D'>If you are just making copies of the image then I would look at
your physical disk data subsystem.  If you do not have a write cache enabler
then it may be your customers disk that is slow and not the software.  I have
run into that situation before with HP Smart Arrays.  You can validate that
this is the case by comparing your CPU usage to the average write disk queue
length.  If the CPU usage is less than your write queue it means your data
subsystem is not able to keep up with the CPU&#8230;basically GDAL is faster
than your hardware.  Your CPU usage should be somewhere between 70 and 100 % is
everything is working fine would be my guess.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas;
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:10.5pt;font-family:Consolas;
color:#1F497D'>Martin<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'>

<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>
gdal-dev-bounces@lists.osgeo.org [mailto:gdal-dev-bounces@lists.osgeo.org] <b>On
Behalf Of </b>Jason Beverage<br>
<b>Sent:</b> Wednesday, May 14, 2008 12:24 PM<br>
<b>To:</b> Even Rouault<br>
<b>Cc:</b> gdal-dev@lists.osgeo.org<br>
<b>Subject:</b> Re: [gdal-dev] Large NITF file performance problems<o:p></o:p></span></p>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal style='margin-bottom:12.0pt'>Hi Even,<br>
<br>
Thanks for your sample file, it really helped.&nbsp; It loads quickly in our
application and in OpenEV so I'll have to look down another route to find out
what's wrong with the customer's data.<br>
<br>
However, it does appear that there is a problem somewhere when doing a
CreateCopy() as Ivan pointed out.&nbsp; I can translate that file to a GeoTiff
in about 40seconds, but writing NITF has been going for about 5 minutes now and
its still on &quot;0&quot; with no progress reported.<br>
<br>
Thanks,<br>
<br>
Jason<o:p></o:p></p>

<div>

<p class=MsoNormal>On Tue, May 13, 2008 at 2:45 PM, Even Rouault &lt;<a
href="mailto:even.rouault@mines-paris.org">even.rouault@mines-paris.org</a>&gt;
wrote:<o:p></o:p></p>

<p class=MsoNormal>Hi,<br>
<br>
I don't really understand why they would have issues with large file sizes<br>
(below the 4 GB of course)<br>
<br>
I've tried the following small python script to generate a 1.2 GB NITF file<br>
filled with '1' as a value :<br>
<br>
#!/usr/bin/env python<br>
<br>
import gdal<br>
<br>
new_ds = gdal.GetDriverByName( 'NITF' ).Create( 'largentf.ntf', 100000, 12000,<br>
1 )<br>
new_ds.GetRasterBand(1).Fill(1)<br>
new_ds = None<br>
<br>
<br>
It runs in less than one minute on my slow machine. I can open the resulting<br>
file with OpenEV and scroll through it quite smoothly. gdalinfo -checksum<br>
largetntf.ntf also runs in about 3 minutes, which seems reasonnable.<br>
<br>
a gdalinfo on the file shows that it is automatically tiled in blocks of<br>
256x256 and by looking at the code I can see that 256x256 tiling is<br>
automatically activated when either the number of lines or columns of the<br>
file is larger than 9999.<br>
<br>
So I don't see any obvious reason why you get poor performance. You could<br>
probably break with a debugger to see where it idles during gdal_translate ?<br>
<br>
I email you the bzip2 result of the 1.2 GB file that is only 1KB... so you can<br>
test on the same file as me.<br>
<br>
As far as your customer is concerned, maybe there is an issue with compression<br>
(for example a very large mono-block JPEG image ?). A 'gdalinfo' on the files<br>
could maybe give some hints ?<br>
<br>
Le Tuesday 13 May 2008 18:21:15 Jason Beverage, vous avez écrit&nbsp;:<o:p></o:p></p>

<div>

<div>

<p class=MsoNormal style='margin-bottom:12.0pt'>&gt; Hi all,<br>
&gt;<br>
&gt; I've got a customer who is using large NITF files (~1.5 GB) and is seeing<br>
&gt; ridiculously slow load times in our application. &nbsp;I don't have access
to<br>
&gt; his data, so I can't test directly, but it seems like the NITF driver may<br>
&gt; have some issues with large file sizes (&gt; 1GB).<br>
&gt;<br>
&gt; To test on my end, I created a few different GeoTiff files (600 MB, 800
MB,<br>
&gt; and 1.2 GB) and tried to convert them to NITF using gdal_translate.<br>
&gt; Converting the 600 and 800 MB files worked just fine and had very<br>
&gt; reasonable speed (few minutes). &nbsp;However, when I tried to use<br>
&gt; gdal_translate on the 1.2 GB file, the process hung at 0% for forever and
I<br>
&gt; had to kill it after waiting for a very long time. &nbsp;It seems as if
there is<br>
&gt; something magical about this 1 GB boundary.<br>
&gt;<br>
&gt; Does anyone have any ideas or suggestions as to what could be causing this<br>
&gt; issue?<br>
&gt;<br>
&gt; Thanks!<br>
&gt;<br>
&gt; Jason<br>
<br>
<o:p></o:p></p>

</div>

</div>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

</body>

</html>