Prepare benchmarks + ~1.7x prepare perf improvement (#121)

* Add prepare benchmarks

* Skip unnecessary peaks

* Cite sample sources
This commit is contained in:
Taj Pereira 2024-11-28 22:36:23 +09:00 committed by Héctor Ramón Jiménez
parent db2c1ca316
commit 28512c8630
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
8 changed files with 964 additions and 43 deletions

View file

@ -107,16 +107,6 @@ impl InnerAtlas {
self.kind.num_channels()
}
pub(crate) fn promote(&mut self, glyph: CacheKey) {
self.glyph_cache.promote(&glyph);
self.glyphs_in_use.insert(glyph);
}
pub(crate) fn put(&mut self, glyph: CacheKey, details: GlyphDetails) {
self.glyph_cache.put(glyph, details);
self.glyphs_in_use.insert(glyph);
}
pub(crate) fn grow(
&mut self,
device: &wgpu::Device,
@ -327,13 +317,6 @@ impl TextAtlas {
did_grow
}
pub(crate) fn glyph(&self, glyph: &CacheKey) -> Option<&GlyphDetails> {
self.mask_atlas
.glyph_cache
.peek(glyph)
.or_else(|| self.color_atlas.glyph_cache.peek(glyph))
}
pub(crate) fn inner_for_content_mut(&mut self, content_type: ContentType) -> &mut InnerAtlas {
match content_type {
ContentType::Color => &mut self.color_atlas,