mirror of
https://github.com/alacritty/alacritty.git
synced 2024-11-25 14:05:41 -05:00
08f348ecea
Loading a glyph from the cache is a very hot operation in the renderer. The original implementation would first check if a glyph was loaded and then call `get()` which would have to search a second time. This showed up as a very slow point in profiles. This patch addresses glyph cache access in two ways: by using a faster hasher optimized for small keys (fnv), and by using the entry API for fetching a cached glyph. The `fnv` hasher is faster than the default and is very efficient for small keys. Using the entry API on the HashMap means only 1 lookup instead of two. The entry API has a downside where the key needs to get cloned on fetches. Reducing the GlyphKey width to 64-bits helps in both areas. Copying an 8-byte wide type is very cheap and thus limits downside of the entry API. The small width also helps with the hasher performance. Over all, this patch reduced typical render times by several hundred microseconds on a 2013 MacBook Pro with a full screen terminal full of text.
60 lines
1.1 KiB
TOML
60 lines
1.1 KiB
TOML
[package]
|
|
name = "alacritty"
|
|
version = "0.1.0"
|
|
authors = ["Joe Wilm <joe@jwilm.com>"]
|
|
license = "Apache-2.0"
|
|
build = "build.rs"
|
|
description = "GPU-accelerated terminal emulator"
|
|
|
|
[[bin]]
|
|
doc = false
|
|
path = "src/main.rs"
|
|
name = "alacritty"
|
|
|
|
[[test]]
|
|
name = "ref"
|
|
harness = false
|
|
|
|
[dependencies]
|
|
libc = "*"
|
|
cgmath = "0.7"
|
|
notify = "2.6"
|
|
bitflags = "*"
|
|
font = { path = "./font" }
|
|
errno = "0.1.6"
|
|
lazy_static = "0.2.2"
|
|
parking_lot = { version = "0.3.1", features = ["nightly"] }
|
|
serde = "0.8"
|
|
serde_yaml = "0.5"
|
|
serde_derive = "0.8"
|
|
vte = "0.2.1"
|
|
mio = "0.6"
|
|
serde_json = "*"
|
|
copypasta = { path = "./copypasta" }
|
|
xdg = "2.0.0"
|
|
log = "0.3"
|
|
clap = "2.20"
|
|
fnv = "1.0.5"
|
|
|
|
clippy = { version = "0.0.104", optional = true }
|
|
|
|
[features]
|
|
default = ["err-println"]
|
|
# Enabling this feature makes shaders automatically reload when changed
|
|
live-shader-reload = []
|
|
err-println = []
|
|
nightly = []
|
|
|
|
[build-dependencies]
|
|
gl_generator = "0.5"
|
|
|
|
[dependencies.glutin]
|
|
git = "https://github.com/jwilm/glutin"
|
|
rev = "af7fe340bd4a2af53ea521defcb4f377cdc588cf"
|
|
|
|
[dev-dependencies]
|
|
rustc-test = { version = "0.1", features = ["capture"] }
|
|
|
|
[profile.release]
|
|
lto = true
|
|
debug = true
|