[mapserver-dev] [performance] mapserver list expressions

Tom Kralidis tomkralidis at hotmail.com
Wed Apr 3 09:12:07 PDT 2013


+1

..Tom

Sent from my iPhone

On 2013-04-03, at 11:16, "thomas bonfort" <thomas.bonfort at gmail.com> wrote:

> While profiling the openstreetmap renderings, I found a relatively low hanging performance speedup related to expressions when doing class filtering. The context relates to when you'd need to apply a given CLASS to multiple attribute values.
> Currently, to apply a single class to multiple values of an attribute, you can either use regular expressions, or use the IN operator, like this:
> 
> LAYER
>   ...
>   CLASSITEM "type"
>   CLASS
>     EXPRESSION /primary|secondary|tertiary/  #regular expression on CLASSITEM
>     EXPRESSION ("[type]" IN "primary,secondary,tertiary") #"complex" parser expression
>     ...
>   END
> END
> 
> Both methods require quite a bit of overhead, either in the regex system calls, or by using quite a few mallocs when going through the IN parser operation.
> 
> We can cut down on this overhead by adding a "list" expression type, denoted by the { } delimiters, where the previous layer definition becomes:
> 
>  LAYER
>   ...
>   CLASSITEM "type"
>   CLASS
>     EXPRESSION {primary,secondary,tertiary}
>     ...
>   END
> END
> 
> The modifications to the code are fairly straightforward, and no backwards incompatibilities are expected as this is a new functionality that does not collide with previous mapserver expressions.
> The changes can be seen here:
> https://github.com/tbonfort/mapserver/commit/fae435d17b099485ab6792bfae3a7d8dd8992b4c . (you can ignore the changes to mapparser.*, they correct a bug in the IN parser and aren't related to the list operator)
> 
> Our parser guru is OK with these changes, so I would like to vote to include this new expression for our 6.4 release.
> 
> I'll start with my +1
> 
> best regards,
> thomas
> _______________________________________________
> mapserver-dev mailing list
> mapserver-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-dev/attachments/20130403/ff01dc7f/attachment-0001.html>
-------------- next part --------------
_______________________________________________
mapserver-dev mailing list
mapserver-dev at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-dev


More information about the mapserver-dev mailing list