4 ms·
* You can use a Vector-like for the `uid_to_did` direction (be sure it doesn't copy on resize, and you may also want to prevent invalidation, so a 2-level vecto
by o11c 3y ago
* You can use a Vector-like for the `uid_to_did` direction (be sure it doesn't copy on resize, and you may also want to prevent invalidation, so a 2-level vector is often a reasonable choice). Depending on design decisions the elements might want to be `Option<String>` instead of just `String`.
* You can get away with uint32 indexes. The interned indexes should local so this shouldn't be a problem even if you think you'll have more than 4 billion global users. (note: all social media combined only has that currently)
* For interned strings specifically it's embarrassingly simple to use a bump allocator for the string data itself.