Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 54742c6

Browse filesBrowse files
authored
perf: switch to hashbrown hashmap in the function registry (#399)
# Summary The function registry as well as the allocator used the standard `std` hashmap, which by default uses a secure but slow hash. We don't need to worry about security here, so switching to hashbrown should give us a fair bit of speed up for free.
1 parent 5ebabbf commit 54742c6
Copy full SHA for 54742c6

File tree

Expand file treeCollapse file tree

2 files changed

+3
-2
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+3
-2
lines changed

‎crates/bevy_mod_scripting_core/src/bindings/allocator.rs

Copy file name to clipboardExpand all lines: crates/bevy_mod_scripting_core/src/bindings/allocator.rs
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ use bevy::{
66
ecs::system::{Res, Resource},
77
prelude::ResMut,
88
reflect::PartialReflect,
9+
utils::hashbrown::HashMap,
910
};
1011
use parking_lot::{RwLock, RwLockReadGuard, RwLockWriteGuard};
1112
use std::{
1213
cell::UnsafeCell,
1314
cmp::Ordering,
14-
collections::HashMap,
1515
fmt::{Display, Formatter},
1616
hash::Hasher,
1717
sync::{atomic::AtomicU64, Arc},

‎crates/bevy_mod_scripting_core/src/bindings/function/script_function.rs

Copy file name to clipboardExpand all lines: crates/bevy_mod_scripting_core/src/bindings/function/script_function.rs
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@ use crate::{
1111
ScriptValue,
1212
};
1313
use bevy::prelude::{Reflect, Resource};
14+
use bevy::utils::hashbrown::HashMap;
1415
use parking_lot::{RwLock, RwLockReadGuard, RwLockWriteGuard};
1516
use std::borrow::Cow;
16-
use std::collections::{HashMap, VecDeque};
17+
use std::collections::VecDeque;
1718
use std::hash::Hash;
1819
use std::ops::{Deref, DerefMut};
1920
use std::sync::Arc;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.