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

Sync changes from mozilla-central gfx/wr #3980

Merged
merged 3 commits into from Jun 10, 2020
Merged

Conversation

@moz-gfx
Copy link

moz-gfx commented Jun 10, 2020

No description provided.

glandium and others added 3 commits Jun 10, 2020
…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
@moz-gfx
Copy link
Author

moz-gfx commented Jun 10, 2020

@bors-servo r=auto

@bors-servo
Copy link
Contributor

bors-servo commented Jun 10, 2020

📌 Commit 388a04a has been approved by auto

@bors-servo
Copy link
Contributor

bors-servo commented Jun 10, 2020

Testing commit 388a04a with merge 1175aca...

@bors-servo
Copy link
Contributor

bors-servo commented Jun 10, 2020

☀️ Test successful - status-taskcluster
Approved by: auto
Pushing 1175aca to master...

@bors-servo bors-servo merged commit 1175aca into servo:master Jun 10, 2020
2 checks passed
2 checks passed
Community-TC (pull_request) TaskGroup: success
Details
homu Test successful
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.