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

Description

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.

The next one saved very quickly too.

This was also OK

However, when the following was submitted, it took 4 to 5 minutes to process, which is an extreme drag in performance

This has also taken 5 minutes to process in my environment.

When it comes to six rule, the processing did not finish after 20 minutes.

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.

Environment

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

Activity

Show:
Andrea Aime
February 15, 2017, 11:47 AM

Mass closing all resolved issues not modified in the last 4 weeks

Go Sato
June 14, 2016, 12:17 PM
Edited

Hi, Thank you for addressing this issue and apologies for my delayed response.

I have tested out the snapshot dated 14 June and it correctly parsed the css in a blink.

Test case 1

Result: Succeeded

Test case 2:

Result: Succeeded

Again, thank you for all your works on sorting this out.

Andrea Aime
June 4, 2016, 5:11 PM

Hi, I believe to have fixed the issue, the fix should be in tomorrow's nightly builds for 2.8.x, 2.9.x and master: http://ares.boundlessgeo.com/geoserver/ (make sure the build is dated June 5th or later)
Could you check one of those and see if the problem is also solved on your end?

Jody Garnett
April 8, 2016, 6:45 PM
Edited

I think you have gathered enough information for a developer to look at this. The actually CSS --> SLD generation is done in the GeoTools project.

This project is volunteer driven, if you are close to a deadline or operating in a commercial context you may wish to look into commercial support options.

If you are a Java developer the code responsible for the generation is here:

You could write a test case with your examples above and explore how generation is performed.

Go Sato
April 8, 2016, 5:57 PM
Edited

Very weird! I have tried the following and it worked correctly and swiftly.

But without "+0", the performance is bogged down.

The use of between seems to make things worse (Btw, I think the tutorial has to be updated as it is saying PropertyIsBetween is not directly compatible with css)

The above created this filter

When there are more than two rules across neg and pos, it did not finish to translate after five minutes.

Fixed

Assignee

Andrea Aime

Reporter

Go Sato

Fix versions

Affects versions