Commit Graph

16 Commits

Author SHA1 Message Date
Mazdak Farrokhzad 8348151915 define SmallHashMap in spacetimedb_data_structures (#4136)
# Description of Changes

Defines `SmallHashMap` in `spacetimedb_data_structures`.
The data structure is a hybrid map that is backed by a vector and linear
scan for the first `M` elements.
Then it falls back into a normal hash map.
For the first `N` elements, where `N < M`, the vector is stored inline.
That is, the vector is a `SmallVec<[(K, V); N>`.
The structure is optimized for access patterns where the keys and values
are accessed together,
therefore, keys and values are not stored separately.

# API and ABI breaking changes

None, just additive.

# Expected complexity level and risk

1

# Testing

A comprehensive proptest suite is added for the datastructure.
2026-01-27 15:15:23 +00:00
Noa 742303ca49 Bump rust-toolchain to rust 1.88 (#2749)
Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com>
2025-07-15 17:39:41 +00:00
Mazdak Farrokhzad 6a8cd7e9e1 Extract object_pool module from PagePool (#2920) 2025-07-04 13:47:26 +00:00
Mazdak Farrokhzad 1166d68e65 Extract spacetimedb-memory-usage & Nix bindings dep on spacetimedb-data-structures (#2919) 2025-07-04 12:54:00 +00:00
Noa 68d23d4c25 Remove spacetimedb-core as a dep of cli (#2244) 2025-04-09 19:37:44 +00:00
Noa c4e637e98b Energy metering for persistent memory usage (#766) 2024-10-15 17:58:34 +00:00
james gilles c046c0b6aa Add ErrorStream combinator (#1543)
Co-authored-by: James Gilles <jgilles@clockworklabs.io>
2024-07-26 19:42:21 +00:00
Mazdak Farrokhzad 344861f290 use nohasher_hash and ahash instead of siphash13 (#1040)
* use nohasher_hash and ahash instead of siphash13

* re-export types in spacetimedb_data_structures::map
2024-04-05 17:30:51 +00:00
Noa 37658aae7e Add rust-version to Cargo.toml (#802)
* Add rust-version to Cargo.toml

* Use workspace inheritance to make bumping the spacetime version easier
2024-02-07 20:02:05 +00:00
Mazdak Farrokhzad a68ad8f85f add ColList: a compact repr of NonEmpty<ColId>, 8 vs 32 bytes (#730) 2024-01-19 23:44:19 +00:00
John Detter 8524d244f3 Version upgrade to 0.8.1 (#729)
Co-authored-by: John Detter <no-reply@boppygames.gg>
2024-01-18 18:16:58 +00:00
John Detter 79ff6dffc6 Version upgrade to 0.8.0 (#622)
Co-authored-by: John Detter <no-reply@boppygames.gg>
2023-12-04 13:19:25 -06:00
Mazdak Farrokhzad 22fd5d7273 Add the slim_slice data-structures (#528)
* add the slim_slice data-structures

* slim_slice: addres some review comments

* slim_slice: add basic SlimSmallSliceBox type + comment on SlimNonEmptyBox

* slim_slice: prefix conversions with 'from_'

* slim_slice: use transmute_copy

* add empty LICENSE file

* pacify clippy
2023-11-16 12:51:01 +00:00
John Detter dff23de939 Version upgrade to v0.7.3 (#536)
Co-authored-by: John Detter <no-reply@boppygames.gg>
2023-11-07 21:55:14 -06:00
John Detter b35e184051 Version Upgrade to v0.7.2-beta (#498)
Co-authored-by: John Detter <no-reply@boppygames.gg>
2023-10-30 16:53:06 -05:00
Mazdak Farrokhzad c566dbae3d spacetimedb-data-structures: new crate + nstr! (#491)
* spacetimedb-data-structures: new crate + nstr!

* nstr: address review comments
2023-10-30 18:00:54 +00:00