Choose the right interner for your workload
masterLasso provides different interner types depending on whether your application is single-threaded or multi-threaded, and whether you need to continue interning strings or just resolve them.
Decision Matrix
| Interner | Thread-safe | Intern String | str to key | key to str | Contention Free | Memory Usage |
|---|---|---|---|---|---|---|
Rodeo | ❌ | ✅ | ✅ | ✅ | N/A | Medium |
ThreadedRodeo | ✅ | ✅ | ✅ | ✅ | ❌ | Most |
RodeoReader | ✅ | ❌ | ✅ | ✅ | ✅ | Medium |
RodeoResolver | ✅ | ❌ | ❌ | ✅ | ✅ | Least |
Usage Guidelines
- Single-threaded workloads: Use
Rodeo. - Multi-threaded workloads (active interning): Use
ThreadedRodeo. Note that you must enable themulti-threadedCargo feature to use this. - Post-interning (Read-only access):
- If you need to find keys for strings (
strtokey): UseRodeoReader. This is contention-free and can be shared across threads. - If you only need to resolve keys to strings (
keytostr): UseRodeoResolver. This provides the lowest possible memory usage and contention-free access.
- If you need to find keys for strings (