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

Perf: use term hashmap in fastfield #2243

Merged
merged 5 commits into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
add comments
  • Loading branch information
PSeitz committed Nov 9, 2023
commit b0893a5d2108b6da4f02645cb17118ebce62acdf
4 changes: 4 additions & 0 deletions stacker/src/arena_hashmap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 10,10 @@ use crate::shared_arena_hashmap::SharedArenaHashMap;
/// The quirky API has the benefit of avoiding
/// the computation of the hash of the key twice,
/// or copying the key as long as there is no insert.
///
/// ArenaHashMap is like SharedArenaHashMap but takes ownership
/// of the memory arena. The memory arena stores the serialized
/// keys and values.
pub struct ArenaHashMap {
shared_arena_hashmap: SharedArenaHashMap,
Copy link
Collaborator

@fulmicoton fulmicoton Nov 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you relationship between ArenaHashMap vs SharedArenaHashMap?

Copy link
Contributor Author

@PSeitz PSeitz Nov 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added some comments to clarify

/// SharedArenaHashMap is like ArenaHashMap but gets the memory arena
/// passed as an argument to the methods.
/// So one MemoryArena can be shared with multiple SharedArenaHashMap.

pub memory_arena: MemoryArena,
Expand Down
4 changes: 4 additions & 0 deletions stacker/src/shared_arena_hashmap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 56,10 @@ impl KeyValue {
/// The quirky API has the benefit of avoiding
/// the computation of the hash of the key twice,
/// or copying the key as long as there is no insert.
///
/// SharedArenaHashMap is like ArenaHashMap but gets the memory arena
/// passed as an argument to the methods.
/// So one MemoryArena can be shared with multiple SharedArenaHashMap.
pub struct SharedArenaHashMap {
table: Vec<KeyValue>,
mask: usize,
Expand Down
Loading