<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18702">
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV>
<DIV><FONT size=2 face=Arial>Hi Nicolas !</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial>I would be interested to know what you finally did 
! ^^</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial>By "rolling mean", I think he suggests to not make 
all the computations for every window of 5x5 pixels.</FONT></DIV>
<DIV><FONT size=2 face=Arial>If your mean uses a simple computation (average for 
example), you don't need to sum all the values for every window ; you can keep 
the previous results to make your computation.</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial>About the multithreading, I don't use it in my code 
for the GDAL part (reading writing protected by mutexes) but I use it for the 
processing part.</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial>Regards and bonne chance ! ^^</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial>Benoît Andrieu<BR><A 
href="mhtml:{4D496746-CA50-43D4-AA1F-B9E81B44AA9A}mid://00000121/!x-usc:mailto:bea@ixsea.com">bea@ixsea.com</A><BR><A 
href="mhtml:{4D496746-CA50-43D4-AA1F-B9E81B44AA9A}mid://00000121/!x-usc:mailto:benoit.andrieu@gmail.com">benoit.andrieu@gmail.com</A></FONT></DIV></DIV>
<BLOCKQUOTE 
style="BORDER-LEFT: #000000 2px solid; PADDING-LEFT: 5px; PADDING-RIGHT: 0px; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px">
  <DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
  <DIV 
  style="FONT: 10pt arial; BACKGROUND: #e4e4e4; font-color: black"><B>From:</B> 
  <A title=nicolas.degarne@gmail.com 
  href="mailto:nicolas.degarne@gmail.com">Nicolas DEGARNE</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>To:</B> <A title=warmerdam@pobox.com 
  href="mailto:warmerdam@pobox.com">Frank Warmerdam</A> ; <A 
  title=gdal-dev@lists.osgeo.org 
  href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>Sent:</B> Wednesday, April 15, 2009 9:27 
  PM</DIV>
  <DIV style="FONT: 10pt arial"><B>Subject:</B> Re: [gdal-dev] How to make my 
  GDAL code faster?</DIV>
  <DIV><BR></DIV>Hy,<BR><BR>Thanks for your help Frank,it's allowed me to 
  improve my program from 200s to 14s that's show a great progress.<BR><BR>I 
  didn't understand what is "rolling mean" could you please explain 
  me?<BR><BR>An other question, is it possible to make multithread 
  process?<BR><BR>thanks a lot for your help<BR><BR>Best 
  regards,<BR><BR>Nicolas<BR><BR><BR><BR><BR><BR><BR><BR>Once you overhaul 
  things to operate on substantial swaths of data, there<BR>may also be some 
  other opportunities for optimizing within your algorithm<BR>(rolling means, 
  for instance) but first solve the big IO overhead 
  bottleneck.<BR><BR><BR><BR><BR><BR>
  <DIV class=gmail_quote>2009/4/15 Frank Warmerdam <SPAN dir=ltr>&lt;<A 
  href="mailto:warmerdam@pobox.com">warmerdam@pobox.com</A>&gt;</SPAN><BR>
  <BLOCKQUOTE 
  style="BORDER-LEFT: rgb(204,204,204) 1px solid; MARGIN: 0pt 0pt 0pt 0.8ex; PADDING-LEFT: 1ex" 
  class=gmail_quote>
    <DIV class=im>Nicolas DEGARNE wrote:<BR>
    <BLOCKQUOTE 
    style="BORDER-LEFT: rgb(204,204,204) 1px solid; MARGIN: 0pt 0pt 0pt 0.8ex; PADDING-LEFT: 1ex" 
    class=gmail_quote>I read on help and /gdal.h/ File Reference that it could 
      exist faster way so I have some ideas like : &nbsp; &nbsp; &nbsp; &nbsp; 
      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Merging the code to c++<BR>&nbsp; 
      &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Using Read/Write block<BR>&nbsp; &nbsp; 
      &nbsp; &nbsp; &nbsp; &nbsp; Use Tile/Block to accelerate the 
      process<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Use the Warpprocess 
      to calulate windows mean's faster<BR><BR>I hope you understand my request 
      and it was clear<BR>&nbsp; &nbsp; &nbsp; 
    &nbsp;<BR></BLOCKQUOTE><BR></DIV>Nicolas,<BR><BR>My advice would be to read 
    an entire 5 line swath into a buffer, and<BR>then operate within that 
    buffer. &nbsp;Very small read/write operations<BR>are pretty expensive with 
    GDAL and your approach of reading five pixels<BR>off one line as a single 
    request is very very fine grained.<BR><BR>Switching to C++ will not help 
    noticably (just reducing one level of<BR>function call overhead, and a bit 
    of extra checking the C API provides).<BR><BR>At this point there is little 
    value in going to exact TIFF tiles or using<BR>the block API.<BR><BR>The 
    Warp API is also going to be very high overhead to compute 
    means.<BR><BR>Once you overhaul things to operate on substantial swaths of 
    data, there<BR>may also be some other opportunities for optimizing within 
    your algorithm<BR>(rolling means, for instance) but first solve the big IO 
    overhead bottleneck.<BR><BR>Best regards,<BR><FONT color=#888888>-- 
    <BR>---------------------------------------+--------------------------------------<BR>I 
    set the clouds in motion - turn up &nbsp; | Frank Warmerdam, <A 
    href="mailto:warmerdam@pobox.com" 
    target=_blank>warmerdam@pobox.com</A><BR>light and sound - activate the 
    windows | <A href="http://pobox.com/%7Ewarmerdam" 
    target=_blank>http://pobox.com/~warmerdam</A><BR>and watch the world go 
    round - Rush &nbsp; &nbsp;| Geospatial Programmer for 
  Rent<BR><BR></FONT></BLOCKQUOTE></DIV><BR><BR clear=all><BR>-- <BR>Nicolas 
  Degarne<BR>76 rue de Nancy<BR>94170 Le Perreux<BR>06 84 93 80 94<BR><A 
  href="mailto:nicolas.degarne@gmail.com">nicolas.degarne@gmail.com</A><BR><BR>
  <P>
  <HR>

  <P></P>_______________________________________________<BR>gdal-dev mailing 
  list<BR>gdal-dev@lists.osgeo.org<BR>http://lists.osgeo.org/mailman/listinfo/gdal-dev</BLOCKQUOTE></BODY></HTML>