diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2019-10-10 00:45:14 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-10 00:45:14 -0400 |
commit | 4ded3038c027ce954358f47d4cb780815733aaad (patch) | |
tree | fcdab00c4970dc3bb646fcadf3da13740f18abc8 | |
parent | 2c280ab6acbd51791a8cbdbd4f7feccb049ce323 (diff) | |
parent | d0913ec5288296edcd9a7c9adfdeccd2d2ec1c35 (diff) | |
download | servo-4ded3038c027ce954358f47d4cb780815733aaad.tar.gz servo-4ded3038c027ce954358f47d4cb780815733aaad.zip |
Auto merge of #24339 - servo:sharing-cache-size, r=emilio
Remove obsolete logic for LRUCache size
The LRUCache implementation has been replaced, and no longer requires a backing store larger than its capacity.
<!-- 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/24339)
<!-- Reviewable:end -->
-rw-r--r-- | components/style/sharing/mod.rs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/components/style/sharing/mod.rs b/components/style/sharing/mod.rs index 38fd6283436..9b8c1275e4b 100644 --- a/components/style/sharing/mod.rs +++ b/components/style/sharing/mod.rs @@ -90,17 +90,14 @@ use uluru::{Entry, LRUCache}; mod checks; /// The amount of nodes that the style sharing candidate cache should hold at -/// most. We'd somewhat like 32, but ArrayDeque only implements certain backing -/// store sizes. A cache size of 32 would mean a backing store of 33, but -/// that's not an implemented size: we can do 32 or 40. +/// most. /// /// The cache size was chosen by measuring style sharing and resulting /// performance on a few pages; sizes up to about 32 were giving good sharing /// improvements (e.g. 3x fewer styles having to be resolved than at size 8) and /// slight performance improvements. Sizes larger than 32 haven't really been /// tested. -pub const SHARING_CACHE_SIZE: usize = 31; -const SHARING_CACHE_BACKING_STORE_SIZE: usize = SHARING_CACHE_SIZE + 1; +pub const SHARING_CACHE_SIZE: usize = 32; /// Opaque pointer type to compare ComputedValues identities. #[derive(Clone, Debug, Eq, PartialEq)] @@ -426,7 +423,7 @@ impl<E: TElement> StyleSharingTarget<E> { } struct SharingCacheBase<Candidate> { - entries: LRUCache<[Entry<Candidate>; SHARING_CACHE_BACKING_STORE_SIZE]>, + entries: LRUCache<[Entry<Candidate>; SHARING_CACHE_SIZE]>, } impl<Candidate> Default for SharingCacheBase<Candidate> { |