diff --git a/README.md b/README.md index e2628b16..8c198076 100644 --- a/README.md +++ b/README.md @@ -617,7 +617,7 @@ The input must be valid UTF-8. orjson maintains a cache of map keys for the duration of the process. This causes a net reduction in memory usage by avoiding duplicate strings. The -keys must be at most 64 bytes to be cached and 1024 entries are stored. +keys must be at most 64 bytes to be cached and 2048 entries are stored. The global interpreter lock (GIL) is held for the duration of the call. diff --git a/src/deserialize/cache.rs b/src/deserialize/cache.rs index 0e3111dd..6653a34c 100644 --- a/src/deserialize/cache.rs +++ b/src/deserialize/cache.rs @@ -1,6 +1,6 @@ // SPDX-License-Identifier: (Apache-2.0 OR MIT) -use associative_cache::{AssociativeCache, Capacity1024, HashDirectMapped, RoundRobinReplacement}; +use associative_cache::{AssociativeCache, Capacity2048, HashDirectMapped, RoundRobinReplacement}; use core::ffi::c_void; use once_cell::unsync::OnceCell; use std::hash::Hasher; @@ -34,7 +34,7 @@ impl Drop for CachedKey { } pub type KeyMap = - AssociativeCache; + AssociativeCache; pub static mut KEY_MAP: OnceCell = OnceCell::new();