mirror of
https://github.com/servo/servo.git
synced 2025-10-01 09:09:15 +01:00
Measure the UA cache.
ServoStyleSetSizes now has two uses, one for the Stylist, and one for the UA cache, and so the patch removes 'Stylist' from the field names. Example output from about:memory: > +----1,359,608 B (00.55%) -- layout > | +----756,488 B (00.31%) -- style-sheet-cache [2] > | +----393,968 B (00.16%) -- servo-ua-cache > | | +--234,496 B (00.10%) -- element-and-pseudos-maps > | | +---59,648 B (00.02%) -- revalidation-selectors > | | +---58,320 B (00.02%) -- invalidation-map > | | +---30,752 B (00.01%) -- other > | | +---10,752 B (00.00%) -- precomputed-pseudos
This commit is contained in:
parent
c6381c66a0
commit
f7023a120e
7 changed files with 114 additions and 84 deletions
|
@ -131,7 +131,7 @@ use style::stylesheets::{StylesheetContents, SupportsRule};
|
|||
use style::stylesheets::StylesheetLoader as StyleStylesheetLoader;
|
||||
use style::stylesheets::keyframes_rule::{Keyframe, KeyframeSelector, KeyframesStepValue};
|
||||
use style::stylesheets::supports_rule::parse_condition_or_declaration;
|
||||
use style::stylist::{RuleInclusion, Stylist};
|
||||
use style::stylist::{add_size_of_ua_cache, RuleInclusion, Stylist};
|
||||
use style::thread_state;
|
||||
use style::timer::Timer;
|
||||
use style::traversal::DomTraversal;
|
||||
|
@ -3768,6 +3768,19 @@ pub extern "C" fn Servo_StyleSet_AddSizeOfExcludingThis(
|
|||
data.add_size_of_children(&mut ops, sizes);
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn Servo_UACache_AddSizeOf(
|
||||
malloc_size_of: GeckoMallocSizeOf,
|
||||
malloc_enclosing_size_of: GeckoMallocSizeOf,
|
||||
sizes: *mut ServoStyleSetSizes
|
||||
) {
|
||||
let mut ops = MallocSizeOfOps::new(malloc_size_of.unwrap(),
|
||||
malloc_enclosing_size_of.unwrap(),
|
||||
None);
|
||||
let sizes = unsafe { sizes.as_mut() }.unwrap();
|
||||
add_size_of_ua_cache(&mut ops, sizes);
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn Servo_StyleSet_MightHaveAttributeDependency(
|
||||
raw_data: RawServoStyleSetBorrowed,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue