Ticket #3454 (closed defect: wontfix)

Opened 3 years ago

Last modified 21 months ago

Poor performance of ECW->ECW window extraction , except when using no-op temporary warped VRT

Reported by: rouault Owned by: warmerdam
Priority: normal Milestone:
Component: GDAL_Raster Version: svn-trunk
Severity: normal Keywords: ECW
Cc:

Description

I've confirmed a report from a user on this forum (French) :  http://georezo.net/forum/viewtopic.php?id=62434

How to reproduce :

0) Let's have a big ECW tile (from example a 21600x21600 x 3 band dataset converted from a BMNG tile) called src.ecw

1) Slow path : gdal_translate -of ECW src.ecw target.ecw -srcwin 0 0 512 512

--> takes 32 s on my PC

2) Fast path :

  • gdalwarp -of VRT src.ecw src.vrt
  • then, gdal_translate -of ECW src.vrt target.ecw -srcwin 0 0 512 512

--> takes 5.8s on my PC

Attached the output of the gdal_translate run with CPL_DEBUG in both cases.

Attachments

slow.txt Download (5.6 KB) - added by rouault 3 years ago.
fast.txt Download (1.7 KB) - added by rouault 3 years ago.

Change History

Changed 3 years ago by rouault

Changed 3 years ago by rouault

Changed 2 years ago by warmerdam

  • status changed from new to assigned

At core the problem here is that requests to the source file are getting issued as one scanline from band1, then one scanline from band 2, then one scanline from band 3, then second scanline from band 1...

This happens due to going through a VRT (from -srcwin) and the added aspect that the ECWCreateCopy is requesting data one line at a time. The problem is not the same - at least not so bad - when copying to a format that does things in chunks instead of single scanlines.

The ECW driver ends up setting a new window for each scanline for each band and setting windows is expensive.

It would help quite a bit if we could get the VRT driver to request all bands at ones but it is pretty inherent in it's architecture that it treats bands as distinct and unrelated so that would be hard. It would also help if we got the ECWCreateCopy method to request a bunch of scanlines at once instead of just one. That is pretty easy but will help only a relatively limited number of circumstances.

/me thinks...

Changed 2 years ago by warmerdam

  • status changed from assigned to closed
  • resolution set to wontfix

On reflection, I don't think it would be prudent to really try and address this situation within the ECW driver.

I'm going to close this ticket since I don't think action is warranted, though we might keep a possible rework of the VRT driver in the back of our mind to treat bands together.

Changed 21 months ago by rouault

Actually, I did a change recently in the VRT driver to help performance in the WMS driver with gdal_translate when using subwindow. The solution was to implement dataset RasterIO() in the very particular case where all VRT bands use an identical source dataset. I'm wondering if it wouldn't help for that ticket (but I haven't tested). The changeset was : http://trac.osgeo.org/gdal/changeset/21990/trunk/gdal/frmts/vrt

Note: See TracTickets for help on using tickets.