1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-30 05:10:03 -04:00

Use parking_lot for wrapping TextureManager

This commit is contained in:
Emil Ernerfeldt
2022-03-20 21:02:14 +01:00
parent 079490b30d
commit 6a3e7d17ac
5 changed files with 15 additions and 10 deletions

View File

@@ -51,7 +51,7 @@ single_threaded = ["atomic_refcell"]
# Only needed if you plan to use the same fonts from multiple threads.
# It comes with a minor performance impact.
multi_threaded = ["parking_lot"]
multi_threaded = []
[dependencies]
@@ -63,7 +63,7 @@ atomic_refcell = { version = "0.1", optional = true } # Used
bytemuck = { version = "1.7.2", optional = true, features = ["derive"] }
cint = { version = "^0.2.2", optional = true }
nohash-hasher = "0.2"
parking_lot = { version = "0.12", optional = true } # Using parking_lot over std::sync::Mutex gives 50% speedups in some real-world scenarios.
parking_lot = "0.12"
serde = { version = "1", optional = true, features = ["derive", "rc"] }
[dev-dependencies]

View File

@@ -1,8 +1,6 @@
use crate::{
emath::NumExt,
mutex::{Arc, RwLock},
ImageData, ImageDelta, TextureId, TextureManager,
};
use crate::{emath::NumExt, mutex::Arc, ImageData, ImageDelta, TextureId, TextureManager};
use parking_lot::RwLock;
/// Used to paint images.
///