[mapserver-dev] Performance issue with hatching with a pattern of a polygon
Stephen Woodbridge
woodbri at swoodbridge.com
Sun Nov 13 07:47:08 PST 2016
If it helps, I ran this against callgrid and here are the top 10 results:
31,004,957,806
/u/software/mapserver-6.4.3/renderers/agg/src/clipper.cpp:ClipperLib::ClipperBase::InsertLocalMinima(ClipperLib::LocalMinima*)
[/usr/local/lib/libmapserver.so.6.4.3]
3,589,730,952
/u/software/mapserver-6.4.3/renderers/agg/src/clipper.cpp:ClipperLib::Clipper::InsertScanbeam(long
long) [/usr/local/lib/libmapserver.so.6.4.3]
868,732,060
/u/software/mapserver-6.4.3/renderers/agg/src/clipper.cpp:ClipperLib::Clipper::InsertEdgeIntoAEL(ClipperLib::TEdge*)
[/usr/local/lib/libmapserver.so.6.4.3]
740,622,844
/u/software/mapserver-6.4.3/renderers/agg/src/clipper.cpp:ClipperLib::E2InsertsBeforeE1(ClipperLib::TEdge&,
ClipperLib::TEdge&) [/usr/local/lib/libmapserver.so.6.4.3]
129,780,453
/u/software/mapserver-6.4.3/renderers/agg/src/clipper.cpp:ClipperLib::ClipperBase::AddPolygon(std::vector<ClipperLib::IntPoint,
std::allocator<ClipperLib::IntPoint> > const&, ClipperLib::PolyType)
[/usr/local/lib/libmapse
rver.so.6.4.3]
88,391,074
/u/software/mapserver-6.4.3/mapquantization.c:pam_lookupacolor
[/usr/local/lib/libmapserver.so.6.4.3]
85,247,191
/u/software/mapserver-6.4.3/mapquantization.c:pam_computeacolorhash
[/usr/local/lib/libmapserver.so.6.4.3]
83,766,569
/u/software/mapserver-6.4.3/renderers/agg/src/clipper.cpp:ClipperLib::Clipper::ProcessEdgesAtTopOfScanbeam(long
long) [/usr/local/lib/libmapserver.so.6.4.3]
83,744,574
/u/software/mapserver-6.4.3/renderers/agg/src/agg_vcgen_stroke.cpp:mapserver::vcgen_stroke::vertex(double*,
double*) [/usr/local/lib/libmapserver.so.6.4.3]
68,963,910
/build/eglibc-oGUzwX/eglibc-2.19/malloc/malloc.c:_int_malloc
[/lib/x86_64-linux-gnu/libc-2.19.so]
-Steve W
On 11/12/2016 3:48 PM, Stephen Woodbridge wrote:
> Hi Devs,
>
> I have a serious performance problem that I'm trying to run down. The
> layer definition is below. It appears to be related to HATCHing with a
> PATTERN of a polygon.
>
> I have narrowed down a test case down to one layer and one class at
> 1:1963 scale that takes 300+ secs to render.
>
> $ /usr/local/bin/mapserv -v
> MapServer version 6.4.3 OUTPUT=PNG OUTPUT=JPEG SUPPORTS=PROJ
> SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=CAIRO SUPPORTS=SVG_SYMBOLS
> SUPPORTS=SVGCAIRO SUPPORTS=ICONV SUPPORTS=FRIBIDI SUPPORTS=WMS_SERVER
> SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WCS_SERVER
> SUPPORTS=FASTCGI SUPPORTS=GEOS INPUT=JPEG INPUT=POSTGIS INPUT=OGR
> INPUT=GDAL INPUT=SHAPEFILE
>
> $ /usr/local/bin/mapserv -nh
> QUERY_STRING='MAP=./test.map&FORMAT=image%2Fpng&MAP_IMAGETYPE=agg_qn&LAYERS=Australia&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&SRS=EPSG%3A900913&BBOX=12813560.707781,-2467980.3837369,12814292.234029,-2467467.4196173&WIDTH=1225&HEIGHT=859'
>> junk.png
> CGI Request 1 on process 14401
> msDrawMap(): rendering using outputformat named agg_qn (AGG/PNG).
> msDrawMap(): WMS/WFS set-up and query, 0.000s
> msDrawMap(): Layer 0 (flats), 314.227s
> msDrawLabelCache(): labelcache_map_edge_buffer = 20
> msDrawMap(): Drawing Label Cache, 0.000s
> msDrawMap() total time: 314.234s
> msSaveImage(stdout) total time: 0.094s
> mapserv request processing time (msLoadMap not incl.): 314.341s
> msFreeMap(): freeing map at 0x10dade0.
> freeLayer(): freeing layer at 0x10e78e0.
>
> The LAYER definition is:
>
> LAYER
> NAME "flats"
> GROUP "Hydrography"
> STATUS ON
> DEBUG 5
> TYPE POLYGON
> DATA "topo-250k/Vector_data/Hydrography/flats"
> PROJECTION "init=epsg:4283" END
> MAXSCALEDENOM 250000
> CLASSITEM "SYMBOL"
> CLASS
> EXPRESSION "23"
> STYLE
> SYMBOL "hatch"
> COLOR "#00cfe6"
> ANGLE 45
> PATTERN 1 2 END
> WIDTH 1
> SIZE 3
> END
> END
> END
>
> If I comment out the PATTERN line it runs like this:
>
> $ /usr/local/bin/mapserv -nh
> QUERY_STRING='MAP=./test.map&FORMAT=image%2Fpng&MAP_IMAGETYPE=agg_qn&LAYERS=Australia&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&SRS=EPSG%3A900913&BBOX=12813560.707781,-2467980.3837369,12814292.234029,-2467467.4196173&WIDTH=1225&HEIGHT=859'
>> junk.png
> CGI Request 1 on process 15462
> msDrawMap(): rendering using outputformat named agg_qn (AGG/PNG).
> msDrawMap(): WMS/WFS set-up and query, 0.000s
> msDrawMap(): Layer 0 (flats), 0.063s
> msDrawLabelCache(): labelcache_map_edge_buffer = 20
> msDrawMap(): Drawing Label Cache, 0.000s
> msDrawMap() total time: 0.070s
> msSaveImage(stdout) total time: 0.094s
> mapserv request processing time (msLoadMap not incl.): 0.177s
> msFreeMap(): freeing map at 0xd9ade0.
> freeLayer(): freeing layer at 0xda78e0.
>
> And changing the pattern to 'PATTERN 2 2 END' cuts the time in about half:
> msDrawMap(): Layer 0 (flats), 164.830s
>
> So it looks like it has to do with the loop that renders the pattern
> while hatching. I found this issue because I am generating dot patterns
> as fills. I could generate images for the fill pattern, but I needed a
> large combination of colors and densities and hatching with a pattern
> fills the need nicely allowing me to vary the density, size of dot and
> color by varying the PATTERN, COLOR, WIDTH, and SIZE parameters.
>
> I can put together a tarball with the shapefile and mapfile and create a
> ticket for this issue if that helps. I have not tried to create a
> FEATURE based object that will replicate this but I suspect that would
> be possible also.
>
> Thoughts?
> -Steve W
>
> ---
> This email has been checked for viruses by Avast antivirus software.
> https://www.avast.com/antivirus
>
> _______________________________________________
> mapserver-dev mailing list
> mapserver-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-dev
---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
More information about the mapserver-dev
mailing list