Skip to content

Commit

Permalink
Use initial capacity for interner (#2272)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dandandan committed Aug 1, 2022
1 parent d4f038a commit b4fa47d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion parquet/src/util/interner.rs
Expand Up @@ -20,6 +20,8 @@ use hashbrown::hash_map::RawEntryMut;
use hashbrown::HashMap;
use std::hash::Hash;

const DEFAULT_DEDUP_CAPACITY: usize = 4096;

/// Storage trait for [`Interner`]
pub trait Storage {
type Key: Copy;
Expand Down Expand Up @@ -53,7 +55,7 @@ impl<S: Storage> Interner<S> {
pub fn new(storage: S) -> Self {
Self {
state: Default::default(),
dedup: Default::default(),
dedup: HashMap::with_capacity_and_hasher(DEFAULT_DEDUP_CAPACITY, ()),
storage,
}
}
Expand Down

0 comments on commit b4fa47d

Please sign in to comment.