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/gfx/lib.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/gfx/lib.rs')
-rw-r--r-- | components/gfx/lib.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/components/gfx/lib.rs b/components/gfx/lib.rs index 0be282fb8f6..e1183753d5e 100644 --- a/components/gfx/lib.rs +++ b/components/gfx/lib.rs @@ -35,6 +35,7 @@ extern crate net; #[macro_use] extern crate util; extern crate msg; +extern crate string_cache; extern crate style; extern crate skia; extern crate time; |