Modify

Opened 8 years ago

Closed 5 years ago

#13275 closed enhancement (wontfix)

[Patch] Use parallel stream for StyledMapRenderer, MultipolygonBuilder?

Reported by: simon04 Owned by: team
Priority: normal Milestone:
Component: Core Version:
Keywords: java8, multipolygon Cc: michael2402

Description

The the parallelized code in StyledMapRenderer, MultipolygonBuilder can be simplified using Java 8's parallel streams.

Attachments (4)

13275.patch (18.6 KB ) - added by simon04 8 years ago.
cache_Area_intersection_v2.patch (24.2 KB ) - added by GerdP 8 years ago.
includes 13275.patch
cache_Area_intersection_v1.patch (9.9 KB ) - added by GerdP 8 years ago.
cache results from Area intersection tests
patch-13275-parallel-draw.patch (21.6 KB ) - added by michael2402 8 years ago.

Download all attachments as: .zip

Change History (28)

by simon04, 8 years ago

Attachment: 13275.patch added

comment:1 by simon04, 8 years ago

Owner: changed from team to simon04
Status: newassigned

comment:2 by simon04, 8 years ago

Type: defectenhancement

comment:3 by GerdP, 8 years ago

I noticed that MultipolygonBuilder is doing a lot of costly Geometry.polygonIntersection() tests
to find out which polygons are inside/outside. Many of these tests can be omitted and thus complex
polygons could be processed much faster. Example: A (outer) polygon o with three inner ways a, b, c.
When the result of Geometry.polygonIntersection(a,b) is OUTSIDE, the result of Geometry.polygonIntersection(b,a)
will also be OUTSIDE, so there is no need to do this calculation, but it is done.
I am working on a patch that stores the results so that the repeated calculations are avoided.

comment:4 by bastiK, 8 years ago

Cc: michael2402 added

Interesting stuff! I see an performance improvement for rendering phase 1. It's hard to measure because of the fluctuations, but could be about 15 %. (Intel i7, 4x2 cores)

by GerdP, 8 years ago

includes 13275.patch

by GerdP, 8 years ago

cache results from Area intersection tests

comment:5 by GerdP, 8 years ago

I've created two patches to show my idea.
cache_Area_intersection_v1.patch : based on 10743
cache_Area_intersection_v2.patch : based on 10743 + 13275.patch

With complex polygons I see
DEBUG: Test 'Multipolygon' completed in 53.5 s
without the patch and with the patch v2:
DEBUG: mp cache: Tests: 6 hit/miss 3/3
DEBUG: mp cache: Tests: 4 hit/miss 2/2
DEBUG: mp cache: Tests: 1888 hit/miss 1125/763
DEBUG: mp cache: Tests: 4 hit/miss 2/2
DEBUG: Test 'Multipolygon' completed in 42.6 s

I am not an expert reg. multi-threading, so I consider this as a proof of concept.

comment:6 by michael2402, 8 years ago

For the test area I used, I saw a decrease in performance (Krarlsruhe, 48.9819932..48.999449, 8.3939586..8.4182991, Potlatch style)

OLD:

BENCHMARK: rendering phase 1 (calculate styles): 813 ms; phase 2 (draw): 837 ms; total: 1,6 s (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 65 ms; phase 2 (draw): 344 ms; total: 385 ms (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 49 ms; phase 2 (draw): 353 ms; total: 372 ms (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 31 ms; phase 2 (draw): 289 ms; total: 309 ms (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 26 ms; phase 2 (draw): 296 ms; total: 309 ms (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 22 ms; phase 2 (draw): 324 ms; total: 335 ms (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 23 ms; phase 2 (draw): 282 ms; total: 291 ms (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 31 ms; phase 2 (draw): 278 ms; total: 297 ms (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 18 ms; phase 2 (draw): 294 ms; total: 301 ms (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 15 ms; phase 2 (draw): 142 ms; total: 148 ms (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 22 ms; phase 2 (draw): 312 ms; total: 321 ms (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 17 ms; phase 2 (draw): 282 ms; total: 289 ms (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 19 ms; phase 2 (draw): 263 ms; total: 271 ms (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 21 ms; phase 2 (draw): 282 ms; total: 290 ms (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 23 ms; phase 2 (draw): 304 ms; total: 311 ms (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 15 ms; phase 2 (draw): 263 ms; total: 269 ms (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 24 ms; phase 2 (draw): 291 ms; total: 298 ms (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 17 ms; phase 2 (draw): 263 ms; total: 270 ms (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 30 ms; phase 2 (draw): 273 ms; total: 291 ms (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 17 ms; phase 2 (draw): 262 ms; total: 269 ms (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 17 ms; phase 2 (draw): 272 ms; total: 279 ms (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 27 ms; phase 2 (draw): 284 ms; total: 291 ms (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 17 ms; phase 2 (draw): 271 ms; total: 278 ms (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 17 ms; phase 2 (draw): 287 ms; total: 294 ms (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 16 ms; phase 2 (draw): 275 ms; total: 281 ms (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 16 ms; phase 2 (draw): 274 ms; total: 280 ms (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 16 ms; phase 2 (draw): 271 ms; total: 278 ms (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 16 ms; phase 2 (draw): 275 ms; total: 282 ms (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 17 ms; phase 2 (draw): 270 ms; total: 277 ms (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 17 ms; phase 2 (draw): 282 ms; total: 289 ms (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 16 ms; phase 2 (draw): 273 ms; total: 280 ms (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 18 ms; phase 2 (draw): 283 ms; total: 290 ms (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 16 ms; phase 2 (draw): 271 ms; total: 278 ms (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 16 ms; phase 2 (draw): 262 ms; total: 268 ms (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 31 ms; phase 2 (draw): 275 ms; total: 294 ms (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 17 ms; phase 2 (draw): 259 ms; total: 267 ms (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 16 ms; phase 2 (draw): 285 ms; total: 292 ms (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 16 ms; phase 2 (draw): 260 ms; total: 267 ms (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 16 ms; phase 2 (draw): 286 ms; total: 292 ms (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 17 ms; phase 2 (draw): 259 ms; total: 267 ms (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 17 ms; phase 2 (draw): 284 ms; total: 291 ms (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 21 ms; phase 2 (draw): 267 ms; total: 274 ms (scale: 206.5005879032801 zoom level: 16)

NEW:

BENCHMARK: rendering phase 1 (calculate styles): 807 ms; phase 2 (draw): 879 ms; total: 1,7 s (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 94 ms; phase 2 (draw): 354 ms; total: 448 ms (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 64 ms; phase 2 (draw): 303 ms; total: 367 ms (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 44 ms; phase 2 (draw): 293 ms; total: 337 ms (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 45 ms; phase 2 (draw): 282 ms; total: 327 ms (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 36 ms; phase 2 (draw): 276 ms; total: 312 ms (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 41 ms; phase 2 (draw): 274 ms; total: 315 ms (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 23 ms; phase 2 (draw): 297 ms; total: 320 ms (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 22 ms; phase 2 (draw): 295 ms; total: 317 ms (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 21 ms; phase 2 (draw): 291 ms; total: 312 ms (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 23 ms; phase 2 (draw): 273 ms; total: 296 ms (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 30 ms; phase 2 (draw): 268 ms; total: 298 ms (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 23 ms; phase 2 (draw): 276 ms; total: 299 ms (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 28 ms; phase 2 (draw): 286 ms; total: 314 ms (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 21 ms; phase 2 (draw): 266 ms; total: 287 ms (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 35 ms; phase 2 (draw): 270 ms; total: 305 ms (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 25 ms; phase 2 (draw): 284 ms; total: 309 ms (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 22 ms; phase 2 (draw): 277 ms; total: 299 ms (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 21 ms; phase 2 (draw): 273 ms; total: 294 ms (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 28 ms; phase 2 (draw): 267 ms; total: 295 ms (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 21 ms; phase 2 (draw): 283 ms; total: 304 ms (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 21 ms; phase 2 (draw): 257 ms; total: 278 ms (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 36 ms; phase 2 (draw): 266 ms; total: 302 ms (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 21 ms; phase 2 (draw): 281 ms; total: 302 ms (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 23 ms; phase 2 (draw): 258 ms; total: 281 ms (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 20 ms; phase 2 (draw): 267 ms; total: 287 ms (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 34 ms; phase 2 (draw): 279 ms; total: 313 ms (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 21 ms; phase 2 (draw): 286 ms; total: 307 ms (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 21 ms; phase 2 (draw): 258 ms; total: 279 ms (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 21 ms; phase 2 (draw): 278 ms; total: 299 ms (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 20 ms; phase 2 (draw): 273 ms; total: 293 ms (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 21 ms; phase 2 (draw): 270 ms; total: 291 ms (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 20 ms; phase 2 (draw): 274 ms; total: 294 ms (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 21 ms; phase 2 (draw): 263 ms; total: 284 ms (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 22 ms; phase 2 (draw): 270 ms; total: 292 ms (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 21 ms; phase 2 (draw): 285 ms; total: 306 ms (scale: 206.5005879032801 zoom level: 16)
BENCHMARK: rendering phase 1 (calculate styles): 21 ms; phase 2 (draw): 270 ms; total: 291 ms (scale: 206.5005879032801 zoom level: 16)

I did some analysis on this several months ago and got the same result: Streams are faster in some complex situations but for basic styles, the extra work required for boxing everything into a stream object does not pay of.

But it makes the code much nicer to read ;-)

BTW: I played around a bit with parallel drawing. This is what I found:

  • Using a simple .parallelStream().collect(new Graphics, paint the element, combine graphics) has horrible performance.
  • Splitting the style elements in chunks should not be done evenly. The first ones to draw are the most expensive ones (areas).
  • merging two graphics is pretty expensive
  • you use up a lot of extra memory.

This are the results using 4 cores:

BENCHMARK: rendering phase 1 (calculate styles): 637 ms; phase 2 (draw): 517 ms; total: 1,2 s (scale: 242.89089332231515 zoom level: 15)
BENCHMARK: rendering phase 1 (calculate styles): 85 ms; phase 2 (draw): 210 ms; total: 295 ms (scale: 242.89089332231515 zoom level: 15)
BENCHMARK: rendering phase 1 (calculate styles): 65 ms; phase 2 (draw): 182 ms; total: 247 ms (scale: 242.89089332231515 zoom level: 15)
BENCHMARK: rendering phase 1 (calculate styles): 57 ms; phase 2 (draw): 157 ms; total: 214 ms (scale: 242.89089332231515 zoom level: 15)
BENCHMARK: rendering phase 1 (calculate styles): 27 ms; phase 2 (draw): 145 ms; total: 172 ms (scale: 242.89089332231515 zoom level: 15)
BENCHMARK: rendering phase 1 (calculate styles): 25 ms; phase 2 (draw): 148 ms; total: 173 ms (scale: 242.89089332231515 zoom level: 15)
BENCHMARK: rendering phase 1 (calculate styles): 30 ms; phase 2 (draw): 149 ms; total: 179 ms (scale: 242.89089332231515 zoom level: 15)
BENCHMARK: rendering phase 1 (calculate styles): 29 ms; phase 2 (draw): 146 ms; total: 175 ms (scale: 242.89089332231515 zoom level: 15)
BENCHMARK: rendering phase 1 (calculate styles): 28 ms; phase 2 (draw): 130 ms; total: 158 ms (scale: 242.89089332231515 zoom level: 15)
BENCHMARK: rendering phase 1 (calculate styles): 35 ms; phase 2 (draw): 131 ms; total: 166 ms (scale: 242.89089332231515 zoom level: 15)
BENCHMARK: rendering phase 1 (calculate styles): 27 ms; phase 2 (draw): 127 ms; total: 154 ms (scale: 242.89089332231515 zoom level: 15)
BENCHMARK: rendering phase 1 (calculate styles): 38 ms; phase 2 (draw): 131 ms; total: 169 ms (scale: 242.89089332231515 zoom level: 15)
BENCHMARK: rendering phase 1 (calculate styles): 22 ms; phase 2 (draw): 137 ms; total: 159 ms (scale: 242.89089332231515 zoom level: 15)
BENCHMARK: rendering phase 1 (calculate styles): 22 ms; phase 2 (draw): 282 ms; total: 304 ms (scale: 242.89089332231515 zoom level: 15)
BENCHMARK: rendering phase 1 (calculate styles): 25 ms; phase 2 (draw): 144 ms; total: 169 ms (scale: 242.89089332231515 zoom level: 15)
BENCHMARK: rendering phase 1 (calculate styles): 23 ms; phase 2 (draw): 126 ms; total: 149 ms (scale: 242.89089332231515 zoom level: 15)
BENCHMARK: rendering phase 1 (calculate styles): 22 ms; phase 2 (draw): 122 ms; total: 144 ms (scale: 242.89089332231515 zoom level: 15)
BENCHMARK: rendering phase 1 (calculate styles): 22 ms; phase 2 (draw): 116 ms; total: 138 ms (scale: 242.89089332231515 zoom level: 15)
BENCHMARK: rendering phase 1 (calculate styles): 34 ms; phase 2 (draw): 123 ms; total: 157 ms (scale: 242.89089332231515 zoom level: 15)
BENCHMARK: rendering phase 1 (calculate styles): 28 ms; phase 2 (draw): 120 ms; total: 148 ms (scale: 242.89089332231515 zoom level: 15)
BENCHMARK: rendering phase 1 (calculate styles): 31 ms; phase 2 (draw): 129 ms; total: 160 ms (scale: 242.89089332231515 zoom level: 15)
BENCHMARK: rendering phase 1 (calculate styles): 37 ms; phase 2 (draw): 119 ms; total: 156 ms (scale: 242.89089332231515 zoom level: 15)
BENCHMARK: rendering phase 1 (calculate styles): 27 ms; phase 2 (draw): 117 ms; total: 144 ms (scale: 242.89089332231515 zoom level: 15)
Version 0, edited 8 years ago by michael2402 (next)

by michael2402, 8 years ago

comment:7 by bastiK, 8 years ago

@Gerd Petermann: Could you please open a new ticket for your work on the multipolygons?

comment:8 by bastiK, 8 years ago

Here are my results:
OLD:

BENCHMARK: rendering phase 1 (calculate styles): 2.5 s; phase 2 (draw): 6.1 s; total: 8.4 s (scale: 1088.6692085678621 zoom level: 13)
BENCHMARK: rendering phase 1 (calculate styles): 798 ms; phase 2 (draw): 1.1 s; total: 1.8 s (scale: 1088.6692085678621 zoom level: 13)
BENCHMARK: rendering phase 1 (calculate styles): 704 ms; phase 2 (draw): 4.3 s; total: 4.9 s (scale: 1088.6692085678621 zoom level: 13)
BENCHMARK: rendering phase 1 (calculate styles): 760 ms; phase 2 (draw): 4.6 s; total: 5.3 s (scale: 1088.6692085678621 zoom level: 13)
BENCHMARK: rendering phase 1 (calculate styles): 793 ms; phase 2 (draw): 4.3 s; total: 5.1 s (scale: 1088.6692085678621 zoom level: 13)
BENCHMARK: rendering phase 1 (calculate styles): 738 ms; phase 2 (draw): 4.3 s; total: 5.0 s (scale: 1088.6692085678621 zoom level: 13)
BENCHMARK: rendering phase 1 (calculate styles): 729 ms; phase 2 (draw): 4.6 s; total: 5.3 s (scale: 1088.6692085678621 zoom level: 13)
BENCHMARK: rendering phase 1 (calculate styles): 731 ms; phase 2 (draw): 4.3 s; total: 4.9 s (scale: 1088.6692085678621 zoom level: 13)
BENCHMARK: rendering phase 1 (calculate styles): 742 ms; phase 2 (draw): 4.5 s; total: 5.2 s (scale: 1088.6692085678621 zoom level: 13)
BENCHMARK: rendering phase 1 (calculate styles): 777 ms; phase 2 (draw): 4.3 s; total: 5.0 s (scale: 1088.6692085678621 zoom level: 13)
BENCHMARK: rendering phase 1 (calculate styles): 677 ms; phase 2 (draw): 4.7 s; total: 5.3 s (scale: 1088.6692085678621 zoom level: 13)

NEW:

BENCHMARK: rendering phase 1 (calculate styles): 3.5 s; phase 2 (draw): 5.7 s; total: 9.2 s (scale: 1088.6692085678621 zoom level: 13)
BENCHMARK: rendering phase 1 (calculate styles): 807 ms; phase 2 (draw): 1.2 s; total: 2.0 s (scale: 1088.6692085678621 zoom level: 13)
BENCHMARK: rendering phase 1 (calculate styles): 873 ms; phase 2 (draw): 4.3 s; total: 5.2 s (scale: 1088.6692085678621 zoom level: 13)
BENCHMARK: rendering phase 1 (calculate styles): 607 ms; phase 2 (draw): 4.3 s; total: 4.9 s (scale: 1088.6692085678621 zoom level: 13)
BENCHMARK: rendering phase 1 (calculate styles): 680 ms; phase 2 (draw): 4.3 s; total: 5.0 s (scale: 1088.6692085678621 zoom level: 13)
BENCHMARK: rendering phase 1 (calculate styles): 946 ms; phase 2 (draw): 4.3 s; total: 5.3 s (scale: 1088.6692085678621 zoom level: 13)
BENCHMARK: rendering phase 1 (calculate styles): 654 ms; phase 2 (draw): 4.3 s; total: 5.0 s (scale: 1088.6692085678621 zoom level: 13)
BENCHMARK: rendering phase 1 (calculate styles): 630 ms; phase 2 (draw): 4.4 s; total: 5.0 s (scale: 1088.6692085678621 zoom level: 13)
BENCHMARK: rendering phase 1 (calculate styles): 573 ms; phase 2 (draw): 4.6 s; total: 5.1 s (scale: 1088.6692085678621 zoom level: 13)
BENCHMARK: rendering phase 1 (calculate styles): 614 ms; phase 2 (draw): 4.3 s; total: 4.9 s (scale: 1088.6692085678621 zoom level: 13)
BENCHMARK: rendering phase 1 (calculate styles): 678 ms; phase 2 (draw): 4.3 s; total: 5.0 s (scale: 1088.6692085678621 zoom level: 13)

The cache is cleared completely after each rendering run. This measures the critical first rendering run. In subsequent runs, the cache kicks in and the overall time is dominated by phase 2.

in reply to:  7 comment:9 by GerdP, 8 years ago

Replying to bastiK:

@Gerd Petermann: Could you please open a new ticket for your work on the multipolygons?

OK, see #13289.

comment:10 by simon04, 8 years ago

Owner: changed from simon04 to team
Status: assignednew
Summary: [Patch] Use parallel stream for StyledMapRenderer, MultipolygonBuilder[Patch] Use parallel stream for StyledMapRenderer, MultipolygonBuilder?

comment:11 by Don-vip, 8 years ago

Milestone: 16.0816.09

comment:12 by simon04, 8 years ago

Milestone: 16.0916.10

comment:13 by simon04, 8 years ago

Milestone: 16.1016.11

Milestone renamed

comment:14 by Don-vip, 7 years ago

Milestone: 16.1116.12

Milestone renamed

comment:15 by Don-vip, 7 years ago

Milestone: 16.1217.01

comment:16 by Don-vip, 7 years ago

Milestone: 17.0117.02

comment:17 by Don-vip, 7 years ago

Milestone: 17.0217.03

comment:18 by Don-vip, 7 years ago

Milestone: 17.0317.04

comment:19 by Don-vip, 7 years ago

Milestone: 17.0417.05

comment:20 by Don-vip, 7 years ago

Milestone: 17.05

comment:21 by bastiK, 7 years ago

What is the prospect for this patch? Personally, I see no real advantage in using parallel streams or fork/join pool in these places. If Executors.newFixedThreadPool does the job, then this is the way to go: It is simple, solid and with little overhead. How can you beat it in terms of efficiency?

In any case, if measurements show other strategies to be consistently better, then that's a different story...

comment:22 by michael2402, 7 years ago

I'd say we close it. The code looks nicer using streams, but we lose a lot of performance.

I played around with streams a bit. They are nice but introduce a lot of overhead when handling many small items. I did not see any performance improvement.

comment:23 by Don-vip, 6 years ago

Keywords: multipolygon added

comment:24 by GerdP, 5 years ago

Resolution: wontfix
Status: newclosed

As was pointed out the performance for StyledMapRenderer is not improved and with r15160 I've removed the slow code in MultipolygonBuilder.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.