Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upSync changes from mozilla-central gfx/wr #3980
Merged
+884
−432
Conversation
…er. r=kats Differential Revision: https://phabricator.services.mozilla.com/D78419 [ghsync] From https://hg.mozilla.org/mozilla-central/rev/5b53507e5a9b008c17080652649002cd81238a31
…re cache r=Bert,kvark
Previously, when we decided to evict elements from the texture cache,
a very simple scheme was used. All elements would be scanned, and
any element that was older than a given threshold would be freed.
This is not ideal for a number of reasons:
- When an eviction takes place, a large number of elements must be scanned.
- When we do evict elements, we often evict a large number of elements in
a single frame, causing CPU spikes.
- We often evict more items than necessary, resulting in redundant
uploads of the same elements again on subsequent frames.
This patch introduces a new LRU cache collection, which is used to
manage the lifetime of most texture cache entries [1].
With this change, we can now:
- Efficiently evict items from oldest to newest, without scanning the entire list.
- Efficiently evict only a small number of items per frame, reducing the
chance of CPU frame spikes.
- Evict only enough elements to reduce memory under a specific threshold,
which reduces the number of redundant evictions / re-uploads required.
[1] Picture cache tiles and manual eviction elements are stored inside
the new cache for efficiency, but the lifetime of them is managed
separately by the texture cache.
Differential Revision: https://phabricator.services.mozilla.com/D78216
[ghsync] From https://hg.mozilla.org/mozilla-central/rev/01ccbe217e03b2942a35a07a5cadeb02213bc73d
…landium Differential Revision: https://phabricator.services.mozilla.com/D78903 [ghsync] From https://hg.mozilla.org/mozilla-central/rev/590d76562067863dd840c9ff7cf85d5e8e2d6b4d
|
@bors-servo r=auto |
|
|
|
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
moz-gfx commentedJun 10, 2020
No description provided.