Crates.io | uuidmap |
lib.rs | uuidmap |
version | 0.3.0 |
created_at | 2025-02-09 05:58:25.928159+00 |
updated_at | 2025-06-04 01:31:43.4527+00 |
description | An ArrayHashMap implementation specialized for using a uuid (u128) as the key. |
homepage | |
repository | https://github.com/AnneKitsune/uuidmap |
max_upload_size | |
id | 1548685 |
size | 75,181 |
This is an ArrayHashMap (otherwise called "Dense Storage" or an enhanced "VecMap"). It is essentially a relational database table. This one is specialized to use a random u128 as the key, rather than a sequential index.
The performances are on-par with modern bitset-based entity-component-systems, while lagging behind archetypal ECS (~3x slower than legion).
However, it has the advantage that it does not constraint someone to follow the ECS pattern of entities and components, with anything else thrown into resources.
Rather, you can use this as a realtime relational database, suitable for game development and game engines.
This means you can store assets, entities, components, resources and events all in the same type Table<T>
. Having it this way cleans up the code, allows for predictable performance and, most importantly, allows for unified tooling. (In-game Table<ItemDefinition>
editor, anyone?)
You can also use it anywhere you would use an in-memory database.
Where you have:
The tables are not thread-safe, by design. You should be using another crate to orchestrate safe table access (no double mutable access, no reads during writes.)
For game engines, I recommend world_dispatcher, which I made for this purpose.
Vec<T>
.