From ef54fb5efc9712b07342097c4ef18ced366879b5 Mon Sep 17 00:00:00 2001 From: makspll Date: Sat, 29 Mar 2025 15:45:12 +0000 Subject: [PATCH 1/2] perf: switch to hashbrown hashmap in the function registry --- .../src/bindings/function/script_function.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/bevy_mod_scripting_core/src/bindings/function/script_function.rs b/crates/bevy_mod_scripting_core/src/bindings/function/script_function.rs index 78075e241b..543d5fe701 100644 --- a/crates/bevy_mod_scripting_core/src/bindings/function/script_function.rs +++ b/crates/bevy_mod_scripting_core/src/bindings/function/script_function.rs @@ -11,9 +11,10 @@ use crate::{ ScriptValue, }; use bevy::prelude::{Reflect, Resource}; +use bevy::utils::hashbrown::HashMap; use parking_lot::{RwLock, RwLockReadGuard, RwLockWriteGuard}; use std::borrow::Cow; -use std::collections::{HashMap, VecDeque}; +use std::collections::VecDeque; use std::hash::Hash; use std::ops::{Deref, DerefMut}; use std::sync::Arc; From 5f47b68b9265b7934fe2bd9f0657da571ebb2021 Mon Sep 17 00:00:00 2001 From: makspll Date: Sat, 29 Mar 2025 15:51:09 +0000 Subject: [PATCH 2/2] change to hashbrown in the allocator --- crates/bevy_mod_scripting_core/src/bindings/allocator.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/bevy_mod_scripting_core/src/bindings/allocator.rs b/crates/bevy_mod_scripting_core/src/bindings/allocator.rs index 93830d0bb2..c37acdb943 100644 --- a/crates/bevy_mod_scripting_core/src/bindings/allocator.rs +++ b/crates/bevy_mod_scripting_core/src/bindings/allocator.rs @@ -6,12 +6,12 @@ use bevy::{ ecs::system::{Res, Resource}, prelude::ResMut, reflect::PartialReflect, + utils::hashbrown::HashMap, }; use parking_lot::{RwLock, RwLockReadGuard, RwLockWriteGuard}; use std::{ cell::UnsafeCell, cmp::Ordering, - collections::HashMap, fmt::{Display, Formatter}, hash::Hasher, sync::{atomic::AtomicU64, Arc},