Skip to content

Commit 4de6389

Browse files
committed
Implement BytesMapping for arrays of integers
**Description** - Fill out changelog - Implement `BytesMapping`, `OrderedBytes`, and `NoPrefixesBytes` for arrays of integers that already have a `BytesMapping`. - This also extends to `Vec<T>` and `Box<[T]>`, except those types don't implement `NoPrefixesBytes` **Motivation** - Changelog is in preparation of a release - Array impls are useful in case user wants an array of integers as a key type. **Testing Done** `./scripts/full_test.sh nightly`
1 parent e70a75d commit 4de6389

File tree

2 files changed

+271
-32
lines changed

2 files changed

+271
-32
lines changed

CHANGELOG.md

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,33 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
99

1010
## [Unreleased] - ReleaseDate
1111

12+
The 0.2.0 has been entirely (99%) contributed by @Gab-Menezes, thank you for all the new features!
13+
14+
Some of the most exciting work they did was to re-implement much of the inner node lookups using SIMD-accelerated searches! The `nightly` feature turns on these optimizations using the new `std::simd` modules. The optimization here also include tactical use of the `likely`, `unlikely`, and `assume` hints to provide the compiler with better optimization material.
15+
16+
They also implemented the "implicit" prefix optimization from the original ART paper, where inner node prefixes longer than X bytes are only stored to X bytes. This means removing the `SmallVec<[u8; X]>` that was previously used to store bytes, which removes the allocation, and overall reduces the memory used.
17+
1218
### Added
1319

14-
TODO
20+
- `TreeMap::entry*` API was added with `try_entry` and `entry_ref` variants. This allows for query and mutating with a single `TreeMap` API call, and can reduce the overhead of a read + mutation.
21+
- Added `TreeMap::fuzzy*` iterator APIs which iterate over keys based on an initial key and a bound on the Levenshtein distance from the original key.
22+
- Added `TreeMap::prefix*` iterator APIs which iterate over keys whose prefix is equal to a given argument
23+
- The `ConcatTuple` type been added so that users can quickly construct a `BytesMapping` for a collection of heterogenous types that individually implement `BytesMapping`. The `ConcatTuple` uses a little bit of type-level mapping, so the generated docs are not the cleanest.
24+
- Implement `BytesMapping` for a restricted set of integer arrays and integer types, which need to be transformed in order for their byte representation to satisfy the `OrderedBytes` trait.
1525

1626
### Changed
1727

18-
TODO
28+
- Increase MSRV to 1.78
29+
- Added new `const PREFIX_LEN: usize` const generic to the `TreeMap` type, with a default value of `16`. This type controls the number of bytes used in each inner node header for storing compressed prefixes. More bytes means storing longer prefixes without without falling back to the implicit prefix, which makes some insertion cases slower. Less bytes means less overall memory usage, and could possibly speed-up lookups.
30+
- This type parameter was added to a lot of other places as well, other functions and traits.
31+
- For the visitor types (`DotPrinter`, `WellFormedChecker`, `TreeStatsCollector`) the functions used to run the visitor on the `TreeMap` are now safe.
32+
- The `TreeStatsCollector` now returns additional stats, grouped by node type.
33+
- Reworked the `BytesMapping` trait so that it is generic over the input type as well, allowing for transformations which can convert multiple different types into bytes.
1934

2035
### Removed
2136

22-
TODO
37+
- Removed implementation of `OrderedBytes` on `[{bool,char,NonZero<*>,i/u-integers}]`. This was replace in favour of restricted implementations on `Vec<T>` or `Box<[T]>` instead.
38+
- Removed the unimplemented `DrainFilter` and some other iterator types that were just stub implementations.
2339

2440
## [0.1.2] - 2023-02-13
2541

0 commit comments

Comments
 (0)