mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-10-05 01:16:33 +00:00

To preface, I tested the impact of these changes by running DOOM-fire-zig in a 120x30 window on a ReleaseFast build. I feel that DOOM-fire-zig is a fairly realistic target when it comes to "high style use" terminal applications. 1. By adjusting the conditions under which we swap items while inserting in to our hash table in `RefCountedSet` we can prioritize styles with many refs, so they're more likely to stay near their target bucket. This change brought DFZ FPS from ~700 to ~840, or a roughly 20% improvement. 2. By changing how we hash `Style` structs, we can avoid a lot of unnecessary overhead and benefit from smaller i-cache size as well as xxHash's better statistical qualities when compared to Wyhash. This change brought DFZ FPS from ~840 to ~1020, or another roughly 20% improvement. These two changes combined represent as roughly 45% improvement over `main`, which is... pretty good I'd say. In addition, I've run `vtebench` and there is no significant difference in the results between this PR and main.