Increase the size of the style sharing cache to 31.

Still a lot of guesswork here, but this does seem to get us better sharing.  See
https://bugzilla.mozilla.org/show_bug.cgi?id=1369621 for some data.
This commit is contained in:
Boris Zbarsky 2017-06-06 22:11:59 -04:00
parent f388c0ab1e
commit 21eafaa9f8
2 changed files with 10 additions and 6 deletions

View file

@ -37,9 +37,11 @@ use traversal::{DomTraversal, PerLevelTraversalData, PreTraverseToken};
///
/// Larger values will increase style sharing cache hits and general DOM locality
/// at the expense of decreased opportunities for parallelism. The style sharing
/// cache can hold 8 entries, but not all styles are shareable, so we set this
/// value to 16. These values have not been measured and could potentially be
/// tuned.
/// cache can hold 31 entries, but not all styles are shareable, so we set this
/// value to 16. The size of the cache has been measured to provide pretty good
/// sharing on a few pages, but could probably use more measurement and tuning.
/// The work unit size is a bit of a guess at the moment; again could use
/// measurement and tuning.
pub const WORK_UNIT_MAX: usize = 16;
/// Verify that the style sharing cache size doesn't change. If it does, we should
@ -48,7 +50,7 @@ pub const WORK_UNIT_MAX: usize = 16;
/// have surprising effects on the parallelism characteristics of the style system.
#[allow(dead_code)]
fn static_assert() {
unsafe { mem::transmute::<_, [u32; STYLE_SHARING_CANDIDATE_CACHE_SIZE]>([1; 8]); }
unsafe { mem::transmute::<_, [u32; STYLE_SHARING_CANDIDATE_CACHE_SIZE]>([1; 31]); }
}
/// A list of node pointers.