Hi Arnaud,

This is good question, and I'd be interested to know the answer.  As a gut reaction, I don't think it'll matter too much.

That said, there are several variables about this which will be specific to your use case.  The best general advice is probably to set up a way to measure performance.  GeoSolutions has free training materials which document using JMeter for testing just like this: https://geoserver.geo-solutions.it/edu/en/enterprise/jmeter.html.

Once you have a way to gather measurement, it might be worth reviewing the general GeoServer documentation for some of the best practices about deploying GeoServer in production: http://docs.geoserver.org/stable/en/user/production/index.html.  I'd specifically call out Marlin; I'd strongly suggest verifying that it is on via the GeoServer Status Page in the UI.

At this point, if you are using JMeter, you should be able to get an idea how about various changes are affecting performance.  Being able to test two versions of the style should give you confidence in your final choices.  (You can also need nerdy about testing the different scale denominator bits, etc, etc by making careful queries in JMeter.)

If you are still wondering about performance... the next step is diving in with a profiler.  I've used YourKit to learn how specific function where working some complex SLDs.  As a result of that, I was able to write custom CQL functions to speed up things.  (This last suggestion is non-trivial.)

I hope that helps.  If this is a business need, a number of companies support GeoServer commercially (http://geoserver.org/support/).

Cheers,

Jim

On 6/1/2018 5:39 AM, Arnaud L. wrote:
Hi list

I'm wrinting a new style and I have to make choices between filters and expressions. I was wondering which one would be more efficient in terms of rendering performance : 2 rules with static style, or one rule with dynamic style ?
One simple example would be (in ysld) :


Filter version, two rules :
rules:
- filter: ${railway = 'rail' AND tunnel <> 'yes'}
  symbolizers:
  - line:
      stroke-color: '#999999'
rules:
- filter: ${railway = 'rail' AND tunnel = 'yes'}
  symbolizers:
  - line:
      stroke-color: '#DDDDDD'


Expression version, one rule, expression in style :
rules:
- filter: ${railway = 'rail'}
  symbolizers:
  - line:
      stroke-color: ${if_then_else(isNull(tunnel),'#999999','#DDDDDD')}


I have mixed feelings about both. I can write filter expressions more easily because the syntax is simple, and I am not familiar with CQL. But I like the compacity of the expression version better.

Thanks for your thoughts !

--
Arnaud

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Geoserver-users mailing list

Please make sure you read the following two resources before posting to this list: - Earning your support instead of buying it, but Ian Turton: http://www.ianturton.com/talks/foss4g.html#/ - The GeoServer user list posting guidelines: http://geoserver.org/comm/userlist-guidelines.html

If you want to request a feature or an improvement, also see this: https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer


Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Geoserver-users mailing list

Please make sure you read the following two resources before posting to this 
list:
- Earning your support instead of buying it, but Ian Turton: 
http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines: 
http://geoserver.org/comm/userlist-guidelines.html

If you want to request a feature or an improvement, also see this: 
https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer


Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to