GIScience / oshdb

OpenStreetMap History Data Analysis Framework
https://ohsome.org
GNU Lesser General Public License v3.0
110 stars 18 forks source link

Fix performance degradation in ignite streaming endpoint #516

Closed tyrasd closed 1 year ago

tyrasd commented 1 year ago

495 had unfortunately introduced a bug[^1] in affinitycall's stream implementation which caused the backend to always use the slow fallback path (i.e. .collect().stream()). This is particularily slow for medium to large bounding boxes, as it will not use the preflight optimizations implemented for stream.

For example, this has the effect that with this version all ohsome-api data extractions are very slow.

[^1]: the concrete problem being that stream.toList() returns an immutable list which cannot be shuffled in the following code line, while the previously used stream.collect(Collectors.toList()) does return a mutable list (even though it does not guarantee the mutability of it, btw).

Checklist