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.
GeoJSONSourceretains any data set viaMap#addSource(...)orGeoJSONSource#setDatain a_datamember. This data is included in theserialized 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
nullafter sending the data to the worker, which would eliminate this overhead.