1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-29 12:50:04 -04:00

Optimization: replace HashSet uses with AHashSet

This commit is contained in:
Emil Ernerfeldt
2021-10-09 14:15:45 +02:00
parent 4dcdd014d6
commit 22a3a75eb5
6 changed files with 19 additions and 20 deletions

View File

@@ -39,6 +39,9 @@ bytemuck = { version = "1.7.2", features = ["derive"], optional = true }
[features]
default = ["default_fonts", "multi_threaded"]
# implement bytemuck on most types.
convert_bytemuck = ["bytemuck", "emath/bytemuck"]
# If set, epaint will use `include_bytes!` to bundle some fonts.
# If you plan on specifying your own fonts you may disable this feature.
default_fonts = []
@@ -52,10 +55,7 @@ extra_asserts = ["emath/extra_asserts"]
mint = ["emath/mint"]
# implement serde on most types.
serialize = ["serde", "emath/serde"]
# implement bytemuck on most types.
convert_bytemuck = ["bytemuck", "emath/bytemuck"]
serialize = ["serde", "ahash/serde", "emath/serde"]
single_threaded = ["atomic_refcell"]

View File

@@ -24,7 +24,7 @@ pub struct Mutex<T>(parking_lot::Mutex<T>);
#[cfg(debug_assertions)]
thread_local! {
static HELD_LOCKS_TLS: std::cell::RefCell<std::collections::HashSet<*const ()>> = std::cell::RefCell::new(std::collections::HashSet::new());
static HELD_LOCKS_TLS: std::cell::RefCell<ahash::AHashSet<*const ()>> = std::cell::RefCell::new(ahash::AHashSet::new());
}
#[cfg(feature = "multi_threaded")]