Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tree_arena: Use hashbrown::HashMap as drop-in replacement to optimize tree-access #774

Merged
merged 1 commit into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ peniko = "0.2.0"
winit = "0.30.4"
tracing = { version = "0.1.40", default-features = false }
smallvec = "1.13.2"
hashbrown = "0.15.2"
dpi = "0.1.1"
image = { version = "0.25.2", default-features = false }
web-time = "1.1.0"
Expand Down
1 change: 1 addition & 0 deletions tree_arena/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ targets = []


[dependencies]
hashbrown.workspace = true

[features]
# This crate contains two implementations of a tree for use in masonry, one safe and the other unsafe.
Expand Down
2 changes: 1 addition & 1 deletion tree_arena/src/tree_arena_safe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

use super::NodeId;

use std::collections::HashMap;
use hashbrown::HashMap;

#[derive(Debug)]
struct TreeNode<T> {
Expand Down
3 changes: 2 additions & 1 deletion tree_arena/src/tree_arena_unsafe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
use super::NodeId;

use std::cell::UnsafeCell;
use std::collections::HashMap;

use hashbrown::HashMap;

#[derive(Debug)]
struct TreeNode<T> {
Expand Down
Loading