Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid retaining GeoJSONSource data on main thread #3220

Open
jfirebaugh opened this issue Sep 19, 2016 · 1 comment
Open

Avoid retaining GeoJSONSource data on main thread #3220

jfirebaugh opened this issue Sep 19, 2016 · 1 comment
Labels
performance ⚡ Speed, stability, CPU usage, memory usage, or power usage

Comments

@jfirebaugh
Copy link
Contributor

GeoJSONSource retains any data set via Map#addSource(...) or GeoJSONSource#setData in a _data member. This data is included in the serialized representation of the source, but as far as I can tell, that's unnecessary: the only thing that serialized sources are used for is style validation, which does not care about GeoJSON data.

Because the data is also passed to the worker, we are effectively doubling the memory requirements of GeoJSON sources. We could avoid creating a member variable, or set it to null after sending the data to the worker, which would eliminate this overhead.

@anandthakker
Copy link
Contributor

One thing we'll need to resolve is how setStyle's diff should handle GeoJSON sources. As of now, we're doing a deep equality test, which is probably not what we want (see also #4006 (comment)).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance ⚡ Speed, stability, CPU usage, memory usage, or power usage
Projects
None yet
Development

No branches or pull requests

2 participants