|
85 | 85 | //! |
86 | 86 | //! | **Property** | **BucketBackend** | **StringBackend** | **BufferBackend** | | Explanation | |
87 | 87 | //! |:-------------|:-----------------:|:-----------------:|:-----------------:|:--|:--| |
88 | | -//! | Fill | 🤷 | 👍 | ⭐ | | Efficiency of filling an empty string interner. | |
89 | | -//! | Fill Duplicates | 1) | 1) | 1) | | Efficiency of filling a string interner with strings that are already interned. | |
90 | | -//! | Resolve | ⭐ | 👍 | 👎 | | Efficiency of resolving a symbol of an interned string. | |
91 | | -//! | Allocations | 🤷 | 👍 | ⭐ | | The number of allocations performed by the backend. | |
92 | | -//! | Footprint | 🤷 | 👍 | ⭐ | | The total heap memory consumed by the backend. | |
93 | | -//! | Iteration | ⭐ | 👍 | 👎 | | Efficiency of iterating over the interned strings. | |
94 | | -//! | | | | | | | |
95 | | -//! | Contiguous | ✅ | ✅ | ❌ | | The returned symbols have contiguous values. | |
96 | | -//! | Stable Refs | ✅ | ❌ | ❌ | | The interned strings have stable references. | |
97 | | -//! | Static Strings | ✅ | ❌ | ❌ | | Allows to intern `&'static str` without heap allocations. | |
| 88 | +//! | Fill | 🤷 | 👍 | ⭐ | | Efficiency of filling an empty string interner. | |
| 89 | +//! | Fill Duplicates | 1) | 1) | 1) | | Efficiency of filling a string interner with strings that are already interned. | |
| 90 | +//! | Resolve | ⭐ | 👍 | 👎 | | Efficiency of resolving a symbol of an interned string. | |
| 91 | +//! | Resolve Unchecked | 👍 | 👍 | ⭐ 2) | | Efficiency of unchecked resolving a symbol of an interned string. | |
| 92 | +//! | Allocations | 🤷 | 👍 | ⭐ | | The number of allocations performed by the backend. | |
| 93 | +//! | Footprint | 🤷 | 👍 | ⭐ | | The total heap memory consumed by the backend. | |
| 94 | +//! | Iteration | ⭐ | 👍 | 👎 | | Efficiency of iterating over the interned strings. | |
| 95 | +//! | | | | | | | |
| 96 | +//! | Contiguous | ✅ | ✅ | ❌ | | The returned symbols have contiguous values. | |
| 97 | +//! | Stable Refs | ✅ | ❌ | ❌ | | The interned strings have stable references. | |
| 98 | +//! | Static Strings | ✅ | ❌ | ❌ | | Allows to intern `&'static str` without heap allocations. | |
98 | 99 | //! |
99 | 100 | //! 1. Performance of interning pre-interned string is the same for all backends since |
100 | 101 | //! this is implemented in the `StringInterner` front-end via a `HashMap` query for |
101 | 102 | //! all `StringInterner` instances. |
102 | 103 | //! |
| 104 | +//! 2. `BufferBackend` is slow with checked resolving because its internal representation |
| 105 | +//! is extremely sensible to the correctness of the symbols, thus a lot of checks |
| 106 | +//! are performed. If you will only use symbols probided by the same instance of |
| 107 | +//! `BufferBackend`, `resolve_unchecked` is a lot faster. |
| 108 | +//! |
103 | 109 | //! ### Legend |
104 | 110 | //! |
105 | 111 | //! | ⭐ | **best performance** | 👍 | **good performance** | 🤷 | **okay performance** | 👎 | **bad performance** | |
|
0 commit comments