Am 10.03.2015 um 16:42 schrieb Paul Hartmann:
> I would be very interested in a basic benchmark / proof of concept!

Here you go. Some hours of work, and JOGl renders basic lines. To make
it fair, I removed everything except the line rendering from the Java2D
renderer.

Those are the results for a big area:
Jogl: [1]
> phase 1 (calculate styles): 5005 ms; phase 2 (draw): 1174 ms; total: 6179 ms 
> (scale: 13284.212039380947 zoom level: 10)
> phase 1 (calculate styles): 4823 ms; phase 2 (draw): 1159 ms; total: 5982 ms 
> (scale: 13284.212039380947 zoom level: 10)
> phase 1 (calculate styles): 4865 ms; phase 2 (draw): 1124 ms; total: 5989 ms 
> (scale: 13284.212039380947 zoom level: 10)

Java2D: [2]
> BENCHMARK: rendering phase 1 (calculate styles): 1277 ms; phase 2 (draw): 
> 12873 ms; total: 14150 ms (scale: 13284.212039380947 zoom level: 10)
> BENCHMARK: rendering phase 1 (calculate styles): 1284 ms; phase 2 (draw): 
> 12793 ms; total: 14077 ms (scale: 13284.212039380947 zoom level: 10)
> BENCHMARK: rendering phase 1 (calculate styles): 1275 ms; phase 2 (draw): 
> 12853 ms; total: 14128 ms (scale: 13284.212039380947 zoom level: 10)

And a smaller area:
Jogl: [3]
> phase 1 (calculate styles): 298 ms; phase 2 (draw): 9 ms; total: 307 ms 
> (scale: 1224.6553582468273 zoom level: 13)
> phase 1 (calculate styles): 285 ms; phase 2 (draw): 10 ms; total: 295 ms 
> (scale: 1224.6553582468273 zoom level: 13)
> phase 1 (calculate styles): 290 ms; phase 2 (draw): 9 ms; total: 299 ms 
> (scale: 1224.6553582468273 zoom level: 13)

Java2D: [4]
> BENCHMARK: rendering phase 1 (calculate styles): 37 ms; phase 2 (draw): 562 
> ms; total: 599 ms (scale: 1224.6553582468273 zoom level: 13)
> BENCHMARK: rendering phase 1 (calculate styles): 41 ms; phase 2 (draw): 562 
> ms; total: 603 ms (scale: 1224.6553582468273 zoom level: 13)
> BENCHMARK: rendering phase 1 (calculate styles): 40 ms; phase 2 (draw): 576 
> ms; total: 616 ms (scale: 1224.6553582468273 zoom level: 13)

The Java2D phases are clear (have a look at the source).

The JOGL phase 1 contains creating the line geometry (computing
positions on screen, ordering by layer, ...). This can be cached and is
a quick and dirty solution currently (some hashtables, lots of temporary
objects and no nice line caps). I think I can get that down to be more
like the old values, but probably not as low as those are (for a
re-render. Unchanged objects could be skipped in this phase, changing of
objects after zooming delayed).

Phase 2 is the time required to collect all triangle buffers and send
them to the graphic card (no VBOs/optimizations used at the moment,
those would speed up phase 2 even more...)

Here are the screen shots:
[1] http://michael.fam-zangl.net/osm/josm-jogl.png
[2] http://michael.fam-zangl.net/osm/josm-java2d.png
[3] http://michael.fam-zangl.net/osm/josm2-jogl.png
[4] http://michael.fam-zangl.net/osm/josm2-java2d.png

Michael

_______________________________________________
josm-dev mailing list
josm-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/josm-dev

Reply via email to