Ways and POIs deduplication performance and correctness improvement by Sublimis · Pull Request #1635 · mapsforge/mapsforge

Deduplication performance and correctness improvement for ways and POIs.

  • Tested using three Germany_oam.osm.map files (just renamed, so exactly 3x duplication), without POIs.
  • MapWorkerPool.DEBUG_TIMING = true, starting with München area on scale = 20km.
  • Tested on AWT only.

Results:

  • DEDUPLICATE (improved) took 2.3 seconds on average (±0.1) to draw the map.
  • RETURN_ALL took 3.1 seconds on average (±0.1) to draw the map.

The performance of the legacy DEDUPLICATE method was tested later and found to be comparable to RETURN_ALL, thus significantly slower (unsurprisingly).

An additional advantage of the new deduplication approach is correctness: This algorithm does not suffer from hash collisions, unlike the previous one. This becomes increasingly important as maps get bigger.

Android wasn't tested, but the relative results could be even better there, given that mobile devices have weaker GPUs. Not sure, though, maybe someone could do some testing on Android.

This makes the DEDUPLICATE method a good candidate for the recommended and default behavior, possibly mitigating the need for map bounding polygons (#1608).