Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

[core] Calculate GeoJSON tile geometries in a background thread #15953

Merged
merged 3 commits into from
Nov 29, 2019

Conversation

pozdnyakov
Copy link
Contributor

@pozdnyakov pozdnyakov commented Nov 20, 2019

Call mapbox::geojsonvt::GeoJSONVT::getTile() in a background thread, so that the rendering thread is not blocked.

Before:
before

After:

after

Fixes https://github.com/mapbox/mapbox-gl-native-team/issues/87

@pozdnyakov pozdnyakov added performance Speed, stability, CPU usage, memory usage, or power usage Core The cross-platform C++ core, aka mbgl labels Nov 20, 2019
@pozdnyakov pozdnyakov self-assigned this Nov 20, 2019
@pozdnyakov pozdnyakov force-pushed the mikhail_geojson_get_tile_in_bg branch 2 times, most recently from d7b1623 to e4bcfef Compare November 22, 2019 12:05
@pozdnyakov pozdnyakov marked this pull request as ready for review November 22, 2019 12:09
@pozdnyakov pozdnyakov added the needs changelog Indicates PR needs a changelog entry prior to merging. label Nov 22, 2019
@pozdnyakov
Copy link
Contributor Author

src/mbgl/tile/geometry_tile_worker.cpp Outdated Show resolved Hide resolved
@pozdnyakov pozdnyakov force-pushed the mikhail_geojson_get_tile_in_bg branch from e4bcfef to 80c1b4f Compare November 22, 2019 14:54
@pozdnyakov pozdnyakov requested a review from a team November 22, 2019 14:54
@pozdnyakov pozdnyakov removed the needs changelog Indicates PR needs a changelog entry prior to merging. label Nov 22, 2019
@pozdnyakov pozdnyakov force-pushed the mikhail_geojson_get_tile_in_bg branch 5 times, most recently from b33ec4e to f68fc51 Compare November 26, 2019 14:41
@pozdnyakov pozdnyakov added the ⚠️ DO NOT MERGE Work in progress, proof of concept, or on hold label Nov 27, 2019
@pozdnyakov
Copy link
Contributor Author

Invoking a thread per geojson source is not quite safe approach, as it can lead to OOM. Need to limit the possible amount of threads.

@pozdnyakov pozdnyakov force-pushed the mikhail_geojson_get_tile_in_bg branch 2 times, most recently from b127015 to e680408 Compare November 28, 2019 17:20
@pozdnyakov pozdnyakov removed the ⚠️ DO NOT MERGE Work in progress, proof of concept, or on hold label Nov 28, 2019
@pozdnyakov
Copy link
Contributor Author

Invoking a thread per geojson source is not quite safe approach, as it can lead to OOM. Need to limit the possible amount of threads.

Fixed with e6804088f0799f5405a0053ce34b97c183dce90a

Call `mapbox::geojsonvt::GeoJSONVT::getTile()` in a background
thread, so that the rendering thread is not blocked.
The newly introduced `GeometryTile::reset()` is
used while GeoJSON tile update in order to prevent from the
parsing of the new data with the stale layers or vice verse.
@pozdnyakov pozdnyakov force-pushed the mikhail_geojson_get_tile_in_bg branch from e680408 to da21ebe Compare November 29, 2019 08:35
@pozdnyakov
Copy link
Contributor Author

Note for change log: Calculate GeoJSON tile geometries in a background thread, so that the rendering thread is not blocked.

@pozdnyakov pozdnyakov merged commit 597757d into master Nov 29, 2019
@pozdnyakov pozdnyakov deleted the mikhail_geojson_get_tile_in_bg branch November 29, 2019 09:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Core The cross-platform C++ core, aka mbgl performance Speed, stability, CPU usage, memory usage, or power usage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants