mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Add some size tests for ElementData and what's inside.
MozReview-Commit-ID: Aj0rryEnJpl
This commit is contained in:
parent
817a2c6cca
commit
c369d0708c
1 changed files with 10 additions and 0 deletions
|
@ -3,9 +3,13 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use selectors::gecko_like_types as dummies;
|
||||
use servo_arc::Arc;
|
||||
use std::mem::{size_of, align_of};
|
||||
use style;
|
||||
use style::data::{ComputedStyle, ElementData, ElementStyles};
|
||||
use style::gecko::selector_parser as real;
|
||||
use style::properties::ComputedValues;
|
||||
use style::rule_tree::StrongRuleNode;
|
||||
|
||||
#[test]
|
||||
fn size_of_selectors_dummy_types() {
|
||||
|
@ -24,6 +28,12 @@ fn size_of_selectors_dummy_types() {
|
|||
// selectors (with the inline hashes) with as few cache misses as possible.
|
||||
size_of_test!(test_size_of_rule, style::stylist::Rule, 40);
|
||||
|
||||
size_of_test!(test_size_of_option_arc_cv, Option<Arc<ComputedValues>>, 16);
|
||||
size_of_test!(test_size_of_option_rule_node, Option<StrongRuleNode>, 16);
|
||||
size_of_test!(test_size_of_computed_style, ComputedStyle, 56);
|
||||
size_of_test!(test_size_of_element_styles, ElementStyles, 72);
|
||||
size_of_test!(test_size_of_element_data, ElementData, 88);
|
||||
|
||||
size_of_test!(test_size_of_property_declaration, style::properties::PropertyDeclaration, 32);
|
||||
|
||||
// This is huge, but we allocate it on the stack and then never move it,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue