Skip to content

Improve LRU cache behavior in SelectorFlagsMap - #19512

Merged
bors-servo merged 2 commits into
servo:masterfrom
mbrubeck:uluru
Dec 7, 2017
Merged

bors-servo merged 2 commits into
servo:masterfrom
mbrubeck:uluru

Conversation

@mbrubeck

@mbrubeck mbrubeck commented Dec 7, 2017 •

Copy link
Copy Markdown
Contributor

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

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

highfive commented Dec 7, 2017

Copy link
Copy Markdown

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

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Dec 7, 2017
@mbrubeck

mbrubeck commented Dec 7, 2017

Copy link
Copy Markdown
Contributor Author

r? @emilio

@emilio

emilio commented Dec 7, 2017

Copy link
Copy Markdown
Member

Nice!

@bors-servo r+

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit 1f22041 has been approved by emilio

@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. labels Dec 7, 2017
@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit 1f22041 with merge 0c13f14...

bors-servo pushed 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
Copy Markdown
Contributor

☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel-css, linux-rel-wpt, mac-dev-unit, mac-rel-css1, mac-rel-css2, mac-rel-wpt1, mac-rel-wpt2, mac-rel-wpt3, mac-rel-wpt4, windows-msvc-dev
Approved by: emilio
Pushing 0c13f14 to master...

@bors-servo
bors-servo merged commit 1f22041 into servo:master Dec 7, 2017
@highfive highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Dec 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants