USearch implementation had 2 layers, the core HNSW structure implemented in `index.hpp` and the high-level wrapper for dense equidimensional vectors in `index_dense.hpp`. In this release, we've made the top layer thinner and cleaner, also making this APIs more similar, error-handling more consistent, and builds faster.
Reducing Dependencies & Accelerating Builds
Previously `index_dense.hpp` had the following STL includes:
cpp
include <thread> // `std::thread`
include <functional> // `std::function`
include <vector> // `std::vector`
include <numeric> // `std::iota`
Those are some of the most common includes in C++ projects, also the ones I like the least. Here are a couple of reasons to hate them, taken from the ["C++ Compile Health Watchdog"](https://artificial-mind.net/projects/compile-health/):
| name | compilation time | lines of code | binary size |
|------------|------------------|---------------|--------------|
| `<functional>` | 82 .. 228 ms | 12.9 .. 27.4 kLoC | 0 .. 141 kB |
| `<vector>` | 32 .. 48 ms | 7.1 .. 8.0 kLoC | 0 .. 8.2 kB |
| `<numeric>` | 7 .. 13 ms | 1.6 .. 2.1 kLoC | 0 .. 3.3 kB |
| `<thread>` | 110 .. 189 ms | 17.5 .. 20.3 kLoC | 0 .. 153 kB |
Reduced Memory Consumption for DBMS-like Users
Most databases using USearch, would prefer to have a smaller index at the cost of some functionality. As mentioned by rschu1ze, if `enable_key_lookups` is disabled, and some external DBMS is responsible for "key to vector" mappings, the memory consumption of the `index_dense_gt` can be further reduced.
Other Improvements
- In update-heavy workloads, it's possible to encounter an undefined behavior, leading to a corrupt index state.
- In aligned-alloc an integer overflow was resolved by antonio2368.
- Search is now exhaustive by default, so if you have ≥10 items in the index and ask for 10 closest vectors, you are expected to get 10, not ≤10.
- Extended `get`, `loadFromPath`, and `viewFromPath` APIs for Java by mccullocht.
- On GCC 12 and older the `pragma region` warning was resolved by mbautin.
- Casts to `uint40_t` slot IDs have been fixed by Ngalstyan4.
- Casts to `b1x8_t` vectors have been fixed by Ngalstyan4.
- Python type annotation has been added by jamesbraza.
- C++ example was patched by SheldonFung98.
- JavaScript duplicate exports patched by eryue0220 & johnhorsema.
- Checking the number of dimensions in Rust by jbrummack.
- Marking Rust index views unsafe with bddap.
- Documenting reserve-save-load behavior with GoodKnight.
- Patching argument types in C tests with brittlewis12.