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

fix tile caching #221

Closed
ansis opened this issue Dec 17, 2013 · 6 comments
Closed

fix tile caching #221

ansis opened this issue Dec 17, 2013 · 6 comments
Assignees
Labels
performance ⚡ Speed, stability, CPU usage, memory usage, or power usage

Comments

@ansis
Copy link
Contributor

ansis commented Dec 17, 2013

e1a7bba#commitcomment-4879825

The tile cache isn't properly used anyway; we should remove or refactor it. The tiles have to be reparsed in a webworker anyway, even if they are in cache, so the only thing we'd "save" is the redownload of the tile which is a non-issue anyway because the tiles are cached. Instead, we should profile the impact on memory usage and keep around the geometries in web workers for future use. This could go along with prefetching covering tiles (when zooming out).

@tmcw tmcw self-assigned this Feb 10, 2014
@tmcw
Copy link
Contributor

tmcw commented Feb 10, 2014

Grabbing this

@gundersen
Copy link

@tmcw @mourner how hard is fixing the tile cache for GL? It will be one of the biggest wins for me as I demo if the tiles stay cached in the browser so I can really show off the smoothness.

cc @edenh @rsudekum

@mourner
Copy link
Member

mourner commented Feb 13, 2014

@gundersen the vector tile downloads are already cached by the browser (for 2 hours), this ticket is only about the fact they are reparsed every time, which leaves some room for memory footprint / performance improvement, but not significantly noticeable.

If browser cache is not enough, we could add a cache manifest so that the tiles are cached forever (until reset).

I think the demo should be good to go in the current state, because any significant improvement would be non-trivial (not a last-minute fix). But maybe @ansis or @tmcw have suggestions.

@mourner mourner added performance and removed bug labels Feb 13, 2014
@ansis
Copy link
Contributor Author

ansis commented Feb 13, 2014

Caching the parsed geometries and labels should have some noticeable impact. Label placement can take 200-400ms in some of the densest areas right now, so caching should let us skip redoing that every time a tile reappears on the screen.

@bsudekum
Copy link

Just to clear of some confusion around @gundersen's question. The tiles have to be reloaded no matter where they are coming whether they are cached or served. If you zoom around then turn off your wifi, the tiles will still load.

@ansis
Copy link
Contributor Author

ansis commented Mar 1, 2014

added in e52bce1 - It holds onto 20 most recently used tiles to avoid reparsing them when quickly switching between zoom levels.

@ansis ansis closed this as completed Mar 1, 2014
bensleveritt pushed a commit to bensleveritt/mapbox-gl-js that referenced this issue Oct 24, 2016
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

5 participants