aboutsummaryrefslogtreecommitdiff
path: root/alacritty/src/display
diff options
context:
space:
mode:
authorKirill Chibisov <contact@kchibisov.com>2023-07-24 06:11:25 +0000
committerGitHub <noreply@github.com>2023-07-24 06:11:25 +0000
commit7b9f32300ee0a249c0872302c97635b460e45ba5 (patch)
treeae6dacdcdb74f32d949a707913c3fdac048cd00a /alacritty/src/display
parentd20cce9401b2d449ee39013da3eb5f0f66a39c98 (diff)
downloadr-alacritty-7b9f32300ee0a249c0872302c97635b460e45ba5.tar.gz
r-alacritty-7b9f32300ee0a249c0872302c97635b460e45ba5.tar.bz2
r-alacritty-7b9f32300ee0a249c0872302c97635b460e45ba5.zip
Use ahash instead of fnv and regular hash function
After evaluation of the ahash with the data alacritty uses it was discovered that it's 1.5-2x times faster when getting the already hashed values, which is the primary cases for alacritty's renderer. Given that ahash is generally faster, all the HashSet and HashMap's inside the alacritty were changed to use it as a hasher function.
Diffstat (limited to 'alacritty/src/display')
-rw-r--r--alacritty/src/display/hint.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/alacritty/src/display/hint.rs b/alacritty/src/display/hint.rs
index 7e2e4126..57087e45 100644
--- a/alacritty/src/display/hint.rs
+++ b/alacritty/src/display/hint.rs
@@ -2,6 +2,7 @@ use std::cmp::Reverse;
use std::collections::HashSet;
use std::iter;
+use ahash::RandomState;
use winit::keyboard::ModifiersState;
use alacritty_terminal::grid::{BidirectionalIterator, Dimensions};
@@ -307,7 +308,7 @@ pub fn visible_unique_hyperlinks_iter<T>(term: &Term<T>) -> impl Iterator<Item =
let mut display_iter = term.grid().display_iter().peekable();
// Avoid creating hints for the same hyperlinks, but from a different places.
- let mut unique_hyperlinks = HashSet::new();
+ let mut unique_hyperlinks = HashSet::<Hyperlink, RandomState>::default();
iter::from_fn(move || {
// Find the start of the next unique hyperlink.