From f48204eee20ddb0a3b23c10d27e3c75fbcd3f7f3 Mon Sep 17 00:00:00 2001 From: Kirill Chibisov Date: Sat, 25 Jan 2020 02:42:23 +0300 Subject: [PATCH] Add font metric caching --- CHANGELOG.md | 1 + alacritty/src/renderer/mod.rs | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 75c49bc..04323ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,6 +37,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Stack overflow when printing shader creation error - Underline position for bitmap fonts - Selection rotating outside of scrolling region +- Throughput performance problems caused by excessive font metric queries ### Removed diff --git a/alacritty/src/renderer/mod.rs b/alacritty/src/renderer/mod.rs index 2a1d872..a099b0d 100644 --- a/alacritty/src/renderer/mod.rs +++ b/alacritty/src/renderer/mod.rs @@ -341,9 +341,7 @@ impl GlyphCache { } pub fn font_metrics(&self) -> font::Metrics { - self.rasterizer - .metrics(self.font_key, self.font_size) - .expect("metrics load since font is loaded at glyph cache creation") + self.metrics } // Calculate font metrics without access to a glyph cache