<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p>Hi Sushrut,</p>
    <p>thanks for answer. I can try to split the SLD, apply the fragment
      to the right layer, and see the performance difference.</p>
    <p>Sergio</p>
    <p><br>
    </p>
    <div class="moz-cite-prefix">On 01/16/2017 03:18 PM, Sushrut
      Shivaswamy wrote:<br>
    </div>
    <blockquote
cite="mid:CAH5mb99yOVsddM+heCfxkZG2RN0ADu2YV4cdmVur_jTyiQGp=g@mail.gmail.com"
      type="cite">
      <div dir="ltr">Hey Sergio,
        <div><br>
        </div>
        <div>The definition of mapObject - > applySLD() in the map
          server documentation is as follows.</div>
        <b>
          <div><b><br>
            </b></div>
          int applySLD(string sldxml)</b>
        <div><b>Apply the SLD document to the map file. </b></div>
        <div><b>The matching between the sld document and the map file
            will be done using the layer’s name.</b></div>
        <div><b>See SLD HowTo for more information on the SLD support.</b></div>
        <div><b><br>
          </b></div>
        <div>Assuming that your SLD document is applied to every layer
          in the mapfile I see two potential areas for bottle necks to
          appear.</div>
        <div><br>
        </div>
        <div>Since the mapping between SLD and layer is based on the
          layer name, what could be happening is that for every
          NamedLayer occurence </div>
        <div>in your SLD,  mapserver must be iterating over all the
          layers in the map file to see which layer name matches the
          name in the SLD.</div>
        <div>For 76 occurences( as stated by you) <b>this would become
            an order n-squared complexity search.</b></div>
        <div><b>Unless mapserver has an internal hash-table like
            structure to associate a layerName with layerObj which I
            doubt, this would take a lot of time</b></div>
        <div><b>and request processing times would scale on n-squared
            basis where n is the the number of NamedLayerOccurences.</b></div>
        <div><br>
        </div>
        <div>The actual styling of a layer based on SLD shouldn't
          increase the time all that much.</div>
        <div><br>
        </div>
        <div>Could you try applying the SLD on a lyer basis instead of
          for the whole map.</div>
        <div><br>
        </div>
        <div>If you have reference to the actual layerObj you could just
          call layerObj - > applySLD().</div>
        <div><br>
        </div>
        <div>This should cut down the time involved in searching through
          the entire map file for a LAYER reference with matching layer
          name.</div>
        <div><br>
        </div>
        <div>Regards,</div>
        <div>Sushrut Shivaswamy</div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
mapserver-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/mapserver-users">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a></pre>
    </blockquote>
    <br>
  </body>
</html>