-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Share parsed tiles across maps #2951
Comments
Related to #899 |
👍 @lucaswoj thinking about this in the context of custom sources, it probably makes sense to implement 1 in a way that allows the |
Hmm -- @lucaswoj right now, for a given coord, the source cache holds one It almost seems like instead of caching
I don't yet know enough about how these work to guess whether they would make such a strategy infeasible. What do you think? |
@anandthakker Ah. Good thinking. We'll need to think a little bigger in terms of the architectural changes needed to support this feature (#2432 would do the trick) |
Closing as stale — not enough interest to pursue this. |
When one page contains many maps which use the similar styles to show the same geographic region we can improve performance by sharing parsed tiles between maps.
#1. Create Globally Unique Tile Identifier
Tiles can be uniquely identified by a hash of their
id
(to accommodate thepaintVertexArray
s)type
layout
propertiespaint
properties which are property-functionsI'm not sure how exactly to handle ref families. The easiest solution is to have an entry in the tile cache per layer, not per ref family. Every entry within the same ref family would still point to the same
Tile
object.This could replace the existing
Tile#id
property#2. Create Shared Tile Cache
The simplest way to implement this is to replace the
SourceCache#_cache
instance property with a staticSourceCache.cache
property, keyed by the globally unique tile identifier ☝️. We will need to tweak the cache's retention policy to suit.We may need to implement this cache as a locking cache to prevent simultaneous requests for the same time from spawning multiple requests.
cc @anandthakker
The text was updated successfully, but these errors were encountered: