Skip to content

Commit

Permalink
update README
Browse files Browse the repository at this point in the history
  • Loading branch information
drash-course committed Jul 6, 2024
1 parent cb273a1 commit 8ae06ff
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,9 @@ The `IString` can be shared and read from any number of threads.
It scales linearly with the number of reading threads.

The tradeoff is that creating a new `IString` is slower.
A radix tree (compact trie) needs to be traversed to deduplicate the new string,
a lock needs to be acquired, and the tree needs to be updated if the string wasn't interned yet.
A radix tree (compact trie) needs to be traversed to deduplicate the new string.
If the string wasn't interned yet, a lock needs to be acquired, the tree needs to be updated,
and string needs to be inserted in storage.
While the tree walk can be done in parallel from multiple threads, the lock prevents linear
scaling for writes.

Expand All @@ -75,9 +76,6 @@ scaling for writes.
Currently the crate uses 2x the interned string storage space because of this (1x in storage,
1x as a clone in the radix tree).

- Free the memory of unused strings in the background / in a cold path. Currenly the memory is
only free'd the next time a new string is inserted in storage, which may be unexpected.

## Contributing

Feel free to open a PR. Any contribution is **greatly appreciated**.
Expand Down

0 comments on commit 8ae06ff

Please sign in to comment.