Commit ac11fb8
committed
Add thread-local string interner for ReString
Introduces InternedReString, a wrapper around ReString that deduplicates
long strings via a per-thread HashSet. Strings longer than size_of::<String>()
are stored as Arc<str> and looked up on construction and during deserialization
(serde and bilrost), so repeated values share a single heap allocation.
Short strings are stored inline and bypass the interner entirely.
The bilrost decode path is optimized with a fast path for contiguous buffers:
when chunk() covers the full string, we read directly as &str and query the
interner without allocating a temporary buffer.1 parent e737496 commit ac11fb8
File tree
6 files changed
+593
-1
lines changed- util/string
- src
- workspace-hack
6 files changed
+593
-1
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
| 24 | + | |
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
| |||
0 commit comments