Use FxHashMap and FxHashSet in hot code paths
We can also use these maps and sets in place of `SeaHasher` because they are also deterministic. Note that we're not swapping std's `HashMap` and `HashSet` wholesale inside of `collections` because on the server we need cryptographically secure collections.
This commit is contained in:
@@ -3,7 +3,7 @@ use crate::{
|
||||
Point, Size,
|
||||
};
|
||||
use anyhow::Result;
|
||||
use collections::HashMap;
|
||||
use collections::FxHashMap;
|
||||
use derive_more::{Deref, DerefMut};
|
||||
use etagere::BucketedAtlasAllocator;
|
||||
use metal::Device;
|
||||
@@ -53,7 +53,7 @@ struct MetalAtlasState {
|
||||
monochrome_textures: Vec<MetalAtlasTexture>,
|
||||
polychrome_textures: Vec<MetalAtlasTexture>,
|
||||
path_textures: Vec<MetalAtlasTexture>,
|
||||
tiles_by_key: HashMap<AtlasKey, AtlasTile>,
|
||||
tiles_by_key: FxHashMap<AtlasKey, AtlasTile>,
|
||||
}
|
||||
|
||||
impl PlatformAtlas for MetalAtlas {
|
||||
|
||||
Reference in New Issue
Block a user