Cache last fontgroup. Style recalc on wikipedia/rust 66ms -> 41ms.

This commit is contained in:
Glenn Watson 2014-10-23 15:50:28 +10:00
parent 012a80cc18
commit b1c226778f
6 changed files with 36 additions and 13 deletions

View file

@ -8,7 +8,7 @@ use std::string;
use std::rc::Rc;
use std::cell::RefCell;
use servo_util::cache::{Cache, HashCache};
use servo_util::smallvec::{SmallVec, SmallVec1};
use servo_util::smallvec::{SmallVec, SmallVec8};
use style::computed_values::{font_variant, font_weight};
use style::style_structs::Font as FontStyle;
use sync::Arc;
@ -165,11 +165,11 @@ impl Font {
}
pub struct FontGroup {
pub fonts: SmallVec1<Rc<RefCell<Font>>>,
pub fonts: SmallVec8<Rc<RefCell<Font>>>,
}
impl FontGroup {
pub fn new(fonts: SmallVec1<Rc<RefCell<Font>>>) -> FontGroup {
pub fn new(fonts: SmallVec8<Rc<RefCell<Font>>>) -> FontGroup {
FontGroup {
fonts: fonts,
}