aboutsummaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
authorJoe Wilm <joe@jwilm.com>2017-07-01 09:58:37 -0700
committerJoe Wilm <jwilm@users.noreply.github.com>2017-07-01 10:24:50 -0700
commit3cdba291242cc1c1684bff7f8242262b1cdeb582 (patch)
treea3c99e43b698c9d0d360f1386b53e5e5777a8512 /src/lib.rs
parent5a220b73db6385f107ff3e4fffad81e8831968be (diff)
downloadalacritty-3cdba291242cc1c1684bff7f8242262b1cdeb582.tar.gz
alacritty-3cdba291242cc1c1684bff7f8242262b1cdeb582.zip
Reduce InstanceData footprint
The InstanceData type in the rendering subsystem was previously 16 floats which occupied a total of 64 bytes per instance. This meant that for every character or background cell drawn, 64 bytes were sent to the GPU. In the case of a 400x100 cell grid, a total of 2.5MB would be sent. This patch reduces InstanceData's size to 26 bytes, a 60% improvement! Using the above example for comparison, a worst case of 1MB would be transferred. The motivation for this patch comes from macOS. Once the terminal grid would reach a certain size, performance experienced a sharp and dramatic drop (render times would go from ~3ms to ~16ms). I don't want to speculate too much on the underlying issue, but suffice it to say that this patch alleviates the problem in my testing.
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 684e89af..0786013e 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -38,6 +38,7 @@ extern crate errno;
extern crate fnv;
extern crate font;
extern crate glutin;
+extern crate half;
extern crate libc;
extern crate mio;
extern crate notify;