From b4fa47d9c8323e45985563e2bd1478aa1a23639e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20Heres?= Date: Tue, 2 Aug 2022 01:25:56 +0200 Subject: [PATCH] Use initial capacity for interner (#2272) --- parquet/src/util/interner.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/parquet/src/util/interner.rs b/parquet/src/util/interner.rs index c0afad8e587..319750dd101 100644 --- a/parquet/src/util/interner.rs +++ b/parquet/src/util/interner.rs @@ -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; @@ -53,7 +55,7 @@ impl Interner { pub fn new(storage: S) -> Self { Self { state: Default::default(), - dedup: Default::default(), + dedup: HashMap::with_capacity_and_hasher(DEFAULT_DEDUP_CAPACITY, ()), storage, } }