[Geoserver-devel] [JIRA] (GEOS-7489) CSS Styling extremely slows down when negative and positive numbers both included

Go Sato created an issue

GeoServer / BugGEOS-7489

CSS Styling extremely slows down when negative and positive numbers both included

Issue Type:

BugBug

Affects Versions:

2.8.2

Assignee:

Unassigned

Components:

CSS

Created:

08/Apr/16 5:50 PM

Environment:

GeoSever 2.8.2
Amazon Linux 4.4.5 (Redhad 4.8.3 - 9)
Oracle JRE: 1.8.0_74
RAM 1024MB

Priority:

HighHigh

Reporter:

Go Sato

I have recently started using CSS Styling instead of vanilla SLD to write a style which colourise population changes between two censuses.

When a CSS like the following was submitted, it takes minutes to process it.

  • It contains more than four rules AND
  • The rules spread from negative to positive numbers (zero is deemed as positive in this context)

For example, the following css were successfully saved within a second.
{{
/* Five rules looking on positive numbers and zero */
[population >= 0][population < 1]

{ stroke: #ffebbe; }

[population >= 1][population < 5]

{ stroke: #fd5912; }

[population >= 5][population < 10]

{ stroke: #fd5912; }

[population >= 10][population < 15]

{ stroke: #fd5912; }

[population >= 15]

{ stroke: #d7191c; }

}}

The next one saved very quickly too.
{{
/* Five rules, negative numbers only. */
[population < -15]

{ stroke: #ffebbe; }

[population >= -15][population < -10]

{ stroke: #fd5912; }

[population >= -10][population < -5]

{ stroke: #fd5912; }

[population >= -5][population < -1]

{ stroke: #fd5912; }

[population >= -1][population < -0.01]

{ stroke: #fd5912; }

}}
This was also OK
{{
/* Four rules, negative and positive numbers. */
[population < -15]

{ stroke: #ffebbe; }

[population >= -15][population < -10]

{ stroke: #fd5912; }

[population >= -10][population < -5]

{ stroke: #fd5912; }

[population >= -1][population < 1]

{ stroke: #fd5912; }

}}

However, when the following was submitted, it took 4 to 5 minutes to process, which is an extreme drag in performance
{{
/* Five rules, negative and positive numbers. */
[population < -15]

{ stroke: #ffebbe; }

[population >= -15][population < -10]

{ stroke: #fd5912; }

[population >= -10][population < -5]

{ stroke: #fd5912; }

[population >= -5][population < -1]

{ stroke: #fd5912; }

[population >= -1][population < 1]

{ stroke: #fd5912; }

}}
This has also taken 5 minutes to process in my environment.
{{
/* Five rules, negative numbers and zero. */
[population < -15]

{ stroke: #ffebbe; }

[population >= -15][population < -10]

{ stroke: #fd5912; }

[population >= -10][population < -5]

{ stroke: #fd5912; }

[population >= -5][population < -1]

{ stroke: #fd5912; }

[population >= -1][population < 0]

{ stroke: #fd5912; }

}}
When it comes to six rule, the processing did not finish after 20 minutes.
{{
/* Six rules, negative and positive numbers. */
[population < -5]

{ stroke: #72b0fc; }

[population >= -5][population < -1]

{ stroke: #b8d4ff; }

[population >= -1][population < 1]

{ stroke: #ffebbe; }

[population >= 1][population < 5]

{ stroke: #fd5912; }

[population >= 5][population < 10]

{ stroke: #fd5912; }

[population >= 10]

{ stroke: #d7191c; }

}}

To summarise, my observations,

  1. If the number of rules are less than or equal to four, GeoServer always digests the CSS quickly.
  2. If there are more than four rules and the selectors contain both numbers less than zero and those greater or equal to zero, GeoServer suddenly slows down to translate the CSS.
  3. It looks like the increase of processing time is exponential against the number of rules.

This is quite frustrating as it takes ages every time to make a change to the styles that follow this pattern.

Add Comment

Add Comment

This message was sent by Atlassian JIRA (v7.2.0-OD-05-030#72002-sha1:7e8526a)

Atlassian logo