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

Improve LRU cache behavior in SelectorFlagsMap #19512

Merged
merged 2 commits into from Dec 7, 2017
Merged

Conversation

@mbrubeck
Copy link
Contributor

mbrubeck commented Dec 7, 2017

This code used to insert duplicate entries to avoid expensive shuffling of the LRU cache. With uluru this is no longer necessary, because reordering the cache is cheap.

Now it uses the LRUCache::find method from uluru 0.2 to update entries in-place. This should increase cache hits by eliminating unnecessary evictions.

This PR also updates arrayvec because uluru depends on it, and immeta because it depends on arrayvec.


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes do not require tests because they don't change behavior

This change is Reviewable

mbrubeck added 2 commits Dec 7, 2017
This code used to insert duplicate entries to avoid expensive shuffling
of the LRU cache.  With uluru this is no longer necessary, because
reordering the cache is cheap.

Now it uses the `LRUCache::find` method from uluru 0.2 to update entries
in-place.  This should improve the hit rate, because it eliminates
unnecessary evictions.
@highfive
Copy link

highfive commented Dec 7, 2017

Heads up! This PR modifies the following files:

  • @bholley: components/style/Cargo.toml, components/style/sharing/mod.rs, components/style/properties/properties.mako.rs, components/style/context.rs
  • @canaltinova: components/style/Cargo.toml, components/style/sharing/mod.rs, components/style/properties/properties.mako.rs, components/style/context.rs
  • @KiChjang: components/net/Cargo.toml
  • @emilio: components/style/Cargo.toml, components/style/sharing/mod.rs, components/style/properties/properties.mako.rs, components/style/context.rs
@mbrubeck
Copy link
Contributor Author

mbrubeck commented Dec 7, 2017

r? @emilio

@emilio
Copy link
Member

emilio commented Dec 7, 2017

Nice!

@bors-servo r+

@bors-servo
Copy link
Contributor

bors-servo commented Dec 7, 2017

📌 Commit 1f22041 has been approved by emilio

@bors-servo
Copy link
Contributor

bors-servo commented Dec 7, 2017

Testing commit 1f22041 with merge 0c13f14...

bors-servo added a commit that referenced this pull request Dec 7, 2017
Improve LRU cache behavior in SelectorFlagsMap

This code used to insert duplicate entries to avoid expensive shuffling of the LRU cache.  With uluru this is no longer necessary, because reordering the cache is cheap.

Now it uses the `LRUCache::find` method from uluru 0.2 to update entries in-place.  This should increase cache hits by eliminating unnecessary evictions.

This PR also updates `arrayvec` because `uluru` depends on it, and `immeta` because it depends on `arrayvec`.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes do not require tests because they don't change behavior

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19512)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Dec 7, 2017

@bors-servo bors-servo merged commit 1f22041 into servo:master Dec 7, 2017
3 checks passed
3 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
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

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