<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.5945" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=394202309-03092010>Hi,</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=394202309-03092010></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=394202309-03092010>I guess that classification has a big effect in your
case. I have been reading that string comparisons are faster than logical
ones. How about to have a try by classifying your shapefile and writing
the classes directly to a new attribute field? </SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=394202309-03092010></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=394202309-03092010>This is my scale dependent group, simplified and
spiced with some typos, I fear. </SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=394202309-03092010></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=394202309-03092010>LAYER<BR> GROUP "Parcels"
<BR> NAME "all_parcels"<BR> TYPE
POLYGON<BR> STATUS ON<BR> DATA
"parcels_2008"<BR> UNITS
METERS<BR> MAXSCALEDENOM
100000<BR> CLASS<BR> NAME
"parcel_class"<BR> STYLE<BR>
OUTLINECOLOR 250 0 180<BR> WIDTH
2<BR> END <BR>
END<BR> METADATA<BR>
"ows_include_items" "AREA, PERIMETER"<BR>
"wms_title"
"all_parcels"<BR> "wms_srs" "EPSG:2393
EPSG:3067 EPSG:4326 EPSG:900913"<BR>
END<BR>
PROJECTION<BR> "init=epsg:2393"
<BR> END<BR> END
<BR>LAYER<BR> GROUP "Parcels"
<BR> NAME "ten_percent"<BR> TYPE
POLYGON<BR> STATUS ON<BR> DATA
"parcels_2008_0"<BR> UNITS
METERS<BR> MAXSCALEDENOM
1000000<BR> MINSCALEDENOM
100000<BR> CLASS<BR> NAME
"parcel_class"<BR>
STYLE<BR> OUTLINECOLOR 250 0
180<BR> WIDTH 2<BR>
END <BR> END<BR>
METADATA<BR> "ows_include_items" "AREA,
PERIMETER"<BR> "wms_title"
"ten_percent"<BR> "wms_srs" "EPSG:2393
EPSG:3067 EPSG:4326 EPSG:900913"<BR>
END<BR>
PROJECTION<BR> "init=epsg:2393"
<BR> END<BR> END
<BR>LAYER<BR> GROUP "Parcels"
<BR> NAME "one_percent"<BR> TYPE
POLYGON<BR> STATUS ON<BR> DATA
"parcels_2008_00"<BR> UNITS
METERS<BR> MINSCALEDENOM
1000000<BR> CLASS<BR> NAME
"parcel_class"<BR>
STYLE<BR> # COLOR 240 240
0<BR> OUTLINECOLOR 250 0
180<BR> WIDTH 2<BR>
END <BR> END<BR>
METADATA<BR> "ows_include_items" "AREA,
PERIMETER"<BR> "wms_title"
"one_percent"<BR> "wms_srs" "EPSG:2393
EPSG:3067 EPSG:4326 EPSG:900913"<BR>
END<BR>
PROJECTION<BR> "init=epsg:2393"
<BR> END<BR> END
<BR>LAYER</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff
size=2></FONT> </DIV>
<DIV dir=ltr align=left><SPAN class=394202309-03092010><FONT face=Arial
color=#0000ff size=2>-Jukka-</FONT></SPAN></DIV><FONT face=Arial color=#0000ff
size=2></FONT><FONT face=Arial color=#0000ff size=2></FONT><FONT face=Arial
color=#0000ff size=2></FONT><FONT face=Arial color=#0000ff size=2></FONT><FONT
face=Arial color=#0000ff size=2></FONT><BR>
<BLOCKQUOTE dir=ltr
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader lang=fi dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>Lähettäjä:</B> Chris Jackson
[mailto:webturtles@gmail.com] <BR><B>Lähetetty:</B> 3. syyskuuta 2010
12:13<BR><B>Vastaanottaja:</B> Rahkonen Jukka<BR><B>Kopio:</B>
mapserver-users@lists.osgeo.org<BR><B>Aihe:</B> Re: [mapserver-users] Display
performance<BR></FONT><BR></DIV>
<DIV></DIV>Hi Jukka<BR><BR>Thanks for the response and the great investigative
work!<BR>My log entry for drawing the layer is - [Fri Sep 03 10:01:25
2010].658000 msDrawMap(): Layer 1 (meanspringpeakflow), 24.500s. :o(<BR><BR>I
do wonder if my Mapfile layer definition is just v.poor (admittedly no
expert!) so have taken an excerpt of the layer defintion (there are about 15
classes in all) - views anyone, should I be loading it a different
way?<BR><BR>Also Jukka, could I get a sample of your <SPAN
style="COLOR: rgb(51,0,51)"><FONT face=Arial size=2>scale dependent WMS GROUP
layer map code - as it sounds like a great idea maybe for this but also some
v.hi-res model grids I am thinking about.</FONT></SPAN><BR><BR>Thanks again,
much appreciated!<BR>Chris<BR><BR>LAYER<BR> NAME
"meanspringpeakflow"<BR> TYPE polygon <BR> DEBUG 5 <BR> DATA
"Tide"<BR> TEMPLATE void<BR> PROJECTION<BR> "+proj=utm
+zone=31 +ellps=GRS80 +units=m +no_defs" <BR> END<BR>
METADATA <BR> "DESCRIPTION" "Mean Spring Peak
Flow"<BR> "RESULT_FIELDS"
"ID,DISTANCE,DEPTH,MEAN_SP_PC"<BR> "RESULT_HEADERS"
"ID,Minimum Distance (m),Average Depth (m),Mean Spring Peak Flow
(m/s)"<BR> "ows_title"
"meanspringpeakflow"<BR> "RESULT_HYPERLINK" "ID|| Load
graphing tool"<BR> END # Metadata <BR>
CLASS<BR>
NAME '> 4.00 (m/s) '<BR>
EXPRESSION ([MEAN_SP_PC] >= 4 AND
[MEAN_SP_PC] < 4.5) <BR>
STYLE<BR>
COLOR 135 99 64<BR>
END #end style<BR>
END # end class<BR>
CLASS<BR> NAME '3.51 -
4.00'<BR> EXPRESSION
([MEAN_SP_PC] >= 3.5 AND [MEAN_SP_PC] < 4) <BR>
STYLE<BR><BR>
COLOR 158 126
63<BR> END #end
style<BR> END # end class<BR>etc
etc<BR><BR><BR>
<DIV class=gmail_quote>On 3 September 2010 09:04, Rahkonen Jukka <SPAN
dir=ltr><<A
href="mailto:Jukka.Rahkonen@mmmtike.fi">Jukka.Rahkonen@mmmtike.fi</A>></SPAN>
wrote:<BR>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
<DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff
size=2><SPAN>Hi,</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff
size=2><SPAN></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN>I took
some numbers to compare with.</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff
size=2><SPAN></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN>Material
and methods</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff
size=2><SPAN></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN>Polygon
layer, rather simple polygons with few vertises, Feature Count:
117383</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN>DEBUG 5
in mapfile</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN>WMS
client asks for the whole layer</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN>Mapserver 5.2.1 (CGI) on
not so fast Windows computer</SPAN></FONT><FONT face=Arial color=#0000ff
size=2></FONT><BR></DIV>
<DIV><SPAN><FONT face=Arial color=#0000ff size=2>Results</FONT></SPAN></DIV>
<DIV><SPAN><FONT face=Arial color=#0000ff size=2>First request: rendering
time taken from the log file are between 3.5 and 4.5
seconds</FONT></SPAN></DIV>
<DIV><SPAN><FONT face=Arial color=#0000ff size=2>Following request, BBOX is
changing but all the polygons are drawn though: rendering times 1.5 -
2.5 seconds</FONT></SPAN></DIV>
<DIV><SPAN><FONT face=Arial color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV><SPAN><FONT face=Arial color=#0000ff size=2>Conclusions and
discussion</FONT></SPAN></DIV>
<DIV><SPAN><FONT face=Arial color=#0000ff size=2>At first one might think
that my server is faster. But this test is not controlled at all
because we are not using the same shapefiles and we can't say so.
What we can say that a couple of hundred of thousand polygons can
be drawn faster. </FONT></SPAN></DIV>
<DIV><SPAN><FONT face=Arial color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV><SPAN><FONT face=Arial color=#0000ff size=2>However, it does not really
make sense to render an image this way if it should be fast. If the
screen has 1000 by 1000 pixels it makes a million pixels together. For
200000 polygons it makes 5 pixels per polygon. You can simplify your
polygon geometries pretty much before anybody can see the
differense. If the polygons are spread evenly nobody can even see
the difference if there are 20000 or 200000 polygons on the
screen.</FONT></SPAN></DIV>
<DIV><SPAN><FONT face=Arial color=#0000ff size=2></FONT></SPAN><SPAN><FONT
face=Arial color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV><SPAN><FONT face=Arial color=#0000ff size=2>We have one polygon layer
with about million polygons and for that I made two simplified layers
which contain only 1 percent and 10 percent of all the polygons. Those
and the original shapefile are put into the same scale dependent WMS
GROUP layer. This group is pretty fast at any scale. The 1
percent layer is perhaps a bit too sparse but I have been too lazy to have a
try with 2 or 5 percent samples.</FONT></SPAN></DIV>
<DIV><SPAN><FONT face=Arial color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV><SPAN><FONT face=Arial color=#0000ff size=2>-Jukka
Rahkonen-</FONT></SPAN></DIV></DIV></BLOCKQUOTE></DIV></BLOCKQUOTE></BODY></HTML>