Conversation
| return cacheEntry.map(it => new OverscaledTileID(it.overscaledZ, it.wrap, it.zoom, it.x, it.y)); | ||
| }; | ||
|
|
||
| const optionsKey = JSON.stringify([options, this._renderWorldCopies]); |
There was a problem hiding this comment.
Probably the ugliest part about this patch:
- Using an array to add
this._renderWorldCopiesinto the hash key, to ensure that changes to that will invalidate the cache. - Using
JSON.stringifyon all arguments to construct a unique hash key.
|
Bundle size report: Size Change: +76 B
ℹ️ View Details
|
|
I was asked to comment on the state of my old PRs. I think this PR should be postponed until #76 has been solved. Just accepting this would unnecessarily complicate the codebase and imply that there's a benefit of doing this, when we are unable to confirm this right now. |
|
This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
|
This PR was closed because it has been stalled for 7 days with no activity. |
|
I don't have time to look into this right now, as the company that I work for no longer prioritizes performance at the moment. I'll reopen this for exposure. |
|
I'm happy to mess around with this and learn something from Jannik. |
|
Closing this in favor of #666 |
Another tiny step towards reducing repaint time for #96.
Occasionally, we'd see a long
coveringTilesin our profiler, which gets worse as you have more sources, because covering tiles are collected for each source seperately.As a short-term solution for this (fighting symptoms, not the cause), we decided to add memoization to our fork. While this doesn't seem to have an impact in practice, it still appears to be a measurable difference, so I'm proposing it here.
We didn't deploy this yet, so this has gotten very little testing.
I wish I could provide better benchmarks, but #76 (and even then, the benchmark might not be suitable for animations).
Also I'm currently working on a macOS machine and have a really hard time to get stable measurements.
I opted to do a rather naive measurement across 1000 frames, with my CPU turbo boost disabled.
Following was measured on a production build using a modified animate-a-line sample on fullscreen map (1680x914 on 1680x1050 display) in Chrome; with a tweak to cause camera zoom on a city in Germany, and the source / layer for the line was duplicated 5 times (with only one of them being animated).
Click here to expand the source-code for my test-case.
Before this PR
After this PR
The above was measured by hooking the
coveringTilesfunction like this:Note that this way of profiling does not consider GC or other side-effects!