diff options
author | bors-servo <metajack+bors@gmail.com> | 2015-04-01 10:00:52 -0600 |
---|---|---|
committer | bors-servo <metajack+bors@gmail.com> | 2015-04-01 10:00:52 -0600 |
commit | ba0d28e0023fce2003d64b9caf97fcdbeb7cdb28 (patch) | |
tree | 0ae3e3ac81eabd2a957a45293b8041ac5a470472 /components/style/parser.rs | |
parent | 6824bc93241d8ad6eff30e5014d27b88ea8a65d7 (diff) | |
parent | 750bbed2cbdd37677b9298c86e20fb6a2db33b23 (diff) | |
download | servo-ba0d28e0023fce2003d64b9caf97fcdbeb7cdb28.tar.gz servo-ba0d28e0023fce2003d64b9caf97fcdbeb7cdb28.zip |
auto merge of #5278 : pcwalton/servo/font-group-caching, r=glennw
There are several optimizations here:
* We make font families atoms, to allow for quicker comparisons.
* We precalculate an FNV hash of the relevant fields of the font style
structure.
* When obtaining a platform font group, we first check pointer equality
for the font style. If there's no match, we go to the FNV hash. Only
if both caches miss do we construct and cache a font group. Note that
individual fonts are *also* cached; thus there are two layers of
caching here.
15% improvement in total layout thread time for Facebook Timeline.
r? @glennw (since you last worked on `get_layout_font_group_for_style()` IIRC)
Diffstat (limited to 'components/style/parser.rs')
-rw-r--r-- | components/style/parser.rs | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/components/style/parser.rs b/components/style/parser.rs index 6fd821f3435..c9d1891d708 100644 --- a/components/style/parser.rs +++ b/components/style/parser.rs @@ -10,7 +10,6 @@ use log; use stylesheets::Origin; - pub struct ParserContext<'a> { pub base_url: &'a Url, pub selector_context: SelectorParserContext, |