diff --git a/crates/hstr/src/dynamic.rs b/crates/hstr/src/dynamic.rs index 344a8238fbcc..54de15d80782 100644 --- a/crates/hstr/src/dynamic.rs +++ b/crates/hstr/src/dynamic.rs @@ -113,6 +113,14 @@ pub(crate) trait Storage { impl Storage for &'_ mut AtomStore { #[inline(never)] fn insert_entry(self, text: Cow, hash: u64) -> Item { + // If the text is too long, interning is not worth it. + if text.len() > 512 { + return Item(ThinArc::from_header_and_slice( + HeaderWithLength::new(Metadata { hash }, text.len()), + text.as_bytes(), + )); + } + let (entry, _) = self .data .raw_entry_mut()