Ticket #3846 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

Polygon hatching implementation is slow in version 6.0

Reported by: tbonfort Owned by: tbonfort
Priority: normal Milestone: 6.0 release
Component: Renderer API Version: svn-trunk (development)
Severity: normal Keywords:
Cc: havatv

Description

As reported by Havard on the mailing list:

I really like the new way of rendering hatches (all hatches are aligned to a global origin). But I have a performance problem with hatches in 6.0.0beta1.

I have a WMS service, and the rendering time is very much higher for 6.0.0beta1 than for version 5, and it scales badly with image size.

  • Example network response times for a 1000x1000 PNG image (Firebug numbers):
    • 6beta1: 11.47s (931.1 KB)
    • 5.6.6: 1.84s (1.2 MB)
  • Example network response times for a 2000x2000 PNG image:
    • 6beta1: 1min 49s (2.9 MB)
    • 5.6.6: 2.36s (4.3 MB)

Change History

Changed 2 years ago by tbonfort

  • status changed from new to assigned

I have found the place in the code where we were failing, and updating it to behave correctly implies losing the stable hatching across polygon boundaries.

The original scanline-boolean that was used in 5.x versions for AGG is still marginally faster than the generic line clipping implementation used in 6.0, so I will extend the renderer API to support the renderPolygonHatched() function. AGG will provide an implemeentation for it, while the other renderers will fall back to the generic clipping code.

Changed 2 years ago by tbonfort

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

committed in r11592.

To obtain stable hatching, the previous algorithm was doing an operation in O(n_image_pixels) for each feature that had to be hatched. The fix that I committed brings this down to O(n_polygon_pixels).

Changed 2 years ago by tbonfort

I opened #3847 for stable hatching across features/images

Note: See TracTickets for help on using tickets.