Skip to content

Commit 219141c

Browse files
ashvardanianjaysenmaraisantonio2368Ngalstyan4adolfogc
authored
Merge pull request #402 from unum-cloud/main-dev
* Improve: Swift test for issue #399 (#400) * Fix: Integer overflow in aligned-alloc Fixes ClickHouse/ClickHouse#61780 Co-authored-by: Antonio Andelic <[email protected]> * Make: Disable Windows NPM builds Relates to the #377 and the comment: #377 (comment) This temporarily disables the failing CI pipeline to generate and update docs. * Fix: Going beyond level 0 in clustering * Improve: Error handling in `index_dense_gt` This commit drops `std::vector` dependency, making compilation time shorter and error handling universal across abstraction layers. * Improve: Remove `std::function` calls * Improve: Remove `std::thread` from `index_dense_gt` * Improve: `std::vector` -> `buffer_gt` in plugins * Add: `usearch_change_threads_search` * Fix: `index_dense_t::make(path)` * Fix: Exhastive Search In the past, if we got "too lucky" traversing the graph, we could exit early before accumulating K top matches, even if the index had more than K entries. This patch changes that behavior, making output more predicatable. * Fix: Replacement leaves isolated nodes This patch addresses the issue #399, originally observed in the Swift layer. Reimplementing it in C++ helped locate the issue and lead to refactoring the `update` procedure in the lowest-layer `index_gt`. Now, `add` and `update` share less code. The `add` is one branch shorter (not that it would be noticeable), and `update` brings additional logic to avoid spilling `updated_slot` into top-results and consequently introducing self-loops. Closes #399 * Fix: Misc warnings & compilation issues * Fix: Misc warnings & compilation issues * Fix: Detect `ring_gt` being full Relates to #355 * Fix: Re-init `available_threads_` after load Both `view` and `load` would `reset` the thread contexts. After that, the very first `search` and `add` would fail, as no thread-local contexts are initialized. It would require a `reserve` call with a non-zero second arcgument to define the number of concurrent threads, for which the queues & buffers need to be allocated. That design is counter-intuitive, so this patch re-inits the same number of threads as before the `load` & `view` or one, if none existed. * Fix: `uint32_t` to `uint40_t` cast (#404) Co-authored-by: Ash Vardanian <[email protected]> * Docs: Mention `b1` in `README.md` Co-authored-by: Adolfo Garcia <[email protected]> * Docs: Cover new users * Improve: Updates stability & catch bug * Fix: Dereferencing `member_iterator_t` * Add: Java `get` API (#407) * Fix: Compilation with `uint40_t` keys * Add: `AutoClosable` using `c_destroy` for Java (#408) * Fix: Rare deadlock on tiny collections * Improve: `enable_key_lookups=false` memory usage As noted by Robert Schulze, we can avoid populating `slot_lookup_` during insertions, if `enable_key_lookups` is not set. This would lead to lower memory consumption for large indexes of tiny vectors, particularly common in GIS. Co-authored-by: Robert Schulze <[email protected]> * Fix: Preset `enable_key_lookups=true` in C * Fix: `std::is_pod` deprecated in C++20 * Fix: Unused type aliases * Improve: Avoid `#pragma region` pre GCC 13 (#386) * Do not use #pragma region if not supported by the compiler * `pragma region` supported by GCC 13+ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85487 --------- Co-authored-by: Mikhail Bautin <[email protected]> Co-authored-by: Ash Vardanian <[email protected]> * Fix: Capacity checks in C# tests * Docs: Add doc-strings in C# * Make: Verbose C# logging in debug builds * Docs: Describe serialization in GoLang * Make: Drop Java & JS API references Compiling and introspecting docstrings in Sphinx is extremely flaky. It's safer to simply describe the usage patterns in the `README.md`. * Add: Load from path in Java (#410) * Improve: Avoid sorting on small "refines" * Docs: Cover JIT-compiled Python examples * Fix: `index.copy()` trying to `memcpy(*, NULL, *)` * Docs: UB in C++ Example (#415) Co-authored-by: Ash Vardanian <[email protected]> * Improve: Catch UB with tests * Docs: Rearrange * Fix: Reserving contexts post-reload * Improve: Detect more failures in tests * Improve: Log failing lines * Fix: Clamp before down-casting to `i8_t` (#422) Previously we were down-casting floats to the target type (e.g. int8_t), and then clamping to [-100, 100] range. This means that e.g. 129 would be cast to -127 and then converted to -100, in stead of becoming 100 The fix does clamping first, and then casts the resulting number (which is guaranteed to be in range [-100, 100], due to clamping) from source type to target int8_t. Given the clamping, this will never overflow. --------- Co-authored-by: Ash Vardanian <[email protected]> * Fix: Concurrency bug in high-K search When calling `index_dense_gt`, the thread lock was not propagating with the `search_result_t`. That is a an error-prone API. When too many threads are running in parallel (ideally, more than physical CPU cores) another thread may start reusing the `context_t` before the original caller finishes exporting entries with `dump_to`. This solution is backwards compatible and passes the tests. * Make: Manually bump version to 2.13.0 We can't yet rely on the SemVer tool semantic-release/release-notes-generator#633 (comment) * Improve: Attempt to implement batch-metrics * Add: Batch-capable metrics * Add: `misaligned_ptr_gt` comparators * Improve: Separate `error_t` constructors This makes debugging easier, as it's simpler to trace where the error message is being set. * Improve: Support `enum` slots Tracing implicit conversions of `std::uint32_t` and other primitive types isn't always easy in concurrent apps. This commit adds support for `enum` types to be used for safer implementation of `index_gt` specializations. * Improve: Ranges-V3 compatibility * Add: Preliminary support for batch metrics * Add: Batch-parallel refinements * Add: `MANIFEST.in` for `py.typed` (#425) Adding type annotation for Python native modules solves the `Skipping analyzing "usearch.index" module` warning due to `missing library stubs or py.typed marker`. Closes #424 * Fix: Clear cast buffer before bitwise ORs for `b1x8_t` (#428) When converting floating point arrays to binary, we use bitwise OR operations to set the relevant bits in the output buffer to 1. We do nothing if the bit is zero, so we assume that the bit is zero to start with. The `memset` statement makes sure this assumption holds. * Fix: `esm` duplicate import bug in `jest` (#420) Closes #418 Closes #426 * Fix: build.gradle deprecations * Fix: ESM build support (#433) Closes #426 Relates to #420 * Fix: `capacity()` assertion in Rust (#436) Closes #432 * Fix: Computing `stats(i).max_edges` * Add: Returning `computed_distances_in_refines` In high-connectivity graphs, the number of distance computations can be dominated by the number of "refine" heuristic computations performed by the core structure. The extended `add_result_t` now includes both: - `computed_distances_in_refines` - `computed_distances_in_reverse_refines` This commit also extends the documentation. * Add: Profiling attributes for `index_gt` * Fix: Preserve thread limits after `fork()` * Improve: Benchmarks self-recall support and `.bbin` This patch adds support for partial datasets, without ground truth neighborhood data. It also adds support for `.bbin` binary, `.hbin` half-precision, and `.dbin` double-precision input vector files/ * Fix: Printing progress between exit * Docs: Fix spelling * Fix: Wolfram bindings (#437) Co-authored-by: Ash Vardanian <[email protected]> * Fix: Pre-reserve enough threads for C users This indirectly fixes the crash in C# layer * Revert: Parallel metrics * Fix: Updating the `entry_slot_` node * Improve: Enable single-threaded update tests * Make: Bump version * Fix: `flat_hash_multi_set_gt::reset` double-free * Fix: Not enough memory in `fork()` * Make: Bump to SimSIMD v5 * Fix: Missing SimSIMD v5 capability names * Improve: Detecting copy & move issues * Fix: Compilation w. explicit `template class` * Improve: Bypass UBSan NULL dereferencing warning * Improve: Minimize alignment issues * Make: Disable `bf16` on MacOS * Make: Link to GitHub repo * Fix: Conditional `call_key` compilation in MSVC * Fix: Unary minus on unsigned distances * Make: Disable `bf16` in JS * Fix: Compatibility with pre-v2.10 Closes #423 * Improve: Test wrong number of dimensions in Rust (#413) Closes #412 --------- Co-authored-by: Julius Brummack <[email protected]> * Fix: Handle wrong dimensionality in Rust * Fix: Overwriting `SIMSIMD_DYNAMIC_DISPATCH` * Make: Upgrade Java version * Fix: Spelling mistakes * Fix: `sprintf` deprecated * Fix: `-Wpass-failed=transform-warning` * Fix: Memory pinning on `Add` in C# * Make: Specify Java distribution * Fix: Pin memory in gets (C#) * Make: Skip `PersistAndRestore` in CI on MacOS * Make: Upgrade Docker action This fixes a GitHub CI warning about the deprecated NodeJS version. * Fix: `view_from_buffer` is unsafe in Rust Closes #453 Co-authored-by: Andrew Dirksen <[email protected]>" * Fix: `view_from_buffer` is unsafe in Rust Closes #453 Co-authored-by: Andrew Dirksen <[email protected]> * Make: Upgrade SimSIMD * Docs: Index header has no capacity The lack of capacity data is intended. Reserving memory is a non-persistent operation by nature, and we shouldn't save that metadata on the disk. Closes #452 Co-authored-by: Christopher Yim <[email protected]> * Fix: Aggressive neighborhood checks on updates * Fix: `update()` bug detect with non-POD keys This bug was tough to spot. Apple Clang was the only one that caught it. The `-O0` flags were explicitly added to expose more symbols for debugging. More `uint40_t` tests were added. * Fix: Align vector type w index in C# (#456) Co-authored-by: Ash Vardanian <[email protected]> * Make: Versioning in pre-release CI * Make: Switch from SemanticRelease to TinySemVer --------- Co-authored-by: Jaysen Marais <[email protected]> Co-authored-by: Antonio Andelic <[email protected]> Co-authored-by: Narek Galstyan <[email protected]> Co-authored-by: Adolfo Garcia <[email protected]> Co-authored-by: Trevor McCulloch <[email protected]> Co-authored-by: Robert Schulze <[email protected]> Co-authored-by: Mikhail Bautin <[email protected]> Co-authored-by: Mikhail Bautin <[email protected]> Co-authored-by: SheldonFung <[email protected]> Co-authored-by: James Braza <[email protected]> Co-authored-by: cinchen <[email protected]> Co-authored-by: Mark Reed <[email protected]> Co-authored-by: John <[email protected]> Co-authored-by: batracos <[email protected]> Co-authored-by: Ziyang Hu <[email protected]> Co-authored-by: Julius Brummack <[email protected]> Co-authored-by: Julius Brummack <[email protected]> Co-authored-by: Andrew Dirksen <[email protected]> Co-authored-by: Christopher Yim <[email protected]> Co-authored-by: Britt <[email protected]>
2 parents 5ea48c8 + 3b366ba commit 219141c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+3747
-1224
lines changed

.github/workflows/prerelease.yml

Lines changed: 39 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,38 @@ permissions:
1717
contents: read
1818

1919
jobs:
20+
versioning:
21+
name: Update Version
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v4
26+
with:
27+
fetch-depth: 0
28+
persist-credentials: false
29+
- name: Run TinySemVer
30+
uses: ashvardanian/[email protected]
31+
with:
32+
verbose: "true"
33+
version-file: "VERSION"
34+
update-version-in: |
35+
package.json:"version": "(\d+\.\d+\.\d+)"
36+
CITATION.cff:^version: (\d+\.\d+\.\d+)
37+
Cargo.toml:^version = "(\d+\.\d+\.\d+)"
38+
wasmer.toml:^version = "(\d+\.\d+\.\d+)"
39+
conanfile.py:version = "(\d+\.\d+\.\d+)"
40+
java/README.md:<version>(\d+\.\d+\.\d+)</version>
41+
README.md:version = {(\d+\.\d+\.\d+)}
42+
csharp/nuget/nuget-package.props:>(\d+\.\d+\.\d+)</Version>
43+
CMakeLists.txt:VERSION (\d+\.\d+\.\d+)
44+
update-major-version-in: |
45+
include/usearch/index.hpp:^#define USEARCH_VERSION_MAJOR (\d+)
46+
update-minor-version-in: |
47+
include/usearch/index.hpp:^#define USEARCH_VERSION_MINOR (\d+)
48+
update-patch-version-in: |
49+
include/usearch/index.hpp:^#define USEARCH_VERSION_PATCH (\d+)
50+
dry-run: "true"
51+
2052
test_ubuntu_gcc:
2153
name: Ubuntu (GCC 12)
2254
runs-on: ubuntu-22.04
@@ -75,9 +107,9 @@ jobs:
75107

76108
# Java
77109
- name: Setup Java
78-
uses: actions/setup-java@v3
110+
uses: actions/setup-java@v4
79111
with:
80-
java-version: "11"
112+
java-version: "21"
81113
distribution: "adopt"
82114
- name: Setup Gradle
83115
uses: gradle/[email protected]
@@ -93,7 +125,7 @@ jobs:
93125
run: |
94126
mkdir -p "${{ github.workspace }}/csharp/lib/runtimes/linux-x64/native"
95127
cp "${{ github.workspace }}/build_artifacts/libusearch_c.so" "${{ github.workspace }}/csharp/lib/runtimes/linux-x64/native"
96-
dotnet test -c Release
128+
dotnet test -c Debug --logger "console;verbosity=detailed"
97129
shell: bash
98130
working-directory: ${{ github.workspace }}/csharp
99131

@@ -168,7 +200,7 @@ jobs:
168200
run: |
169201
mkdir -p "${{ github.workspace }}/csharp/lib/runtimes/linux-x64/native"
170202
cp "${{ github.workspace }}/build_artifacts/libusearch_c.so" "${{ github.workspace }}/csharp/lib/runtimes/linux-x64/native"
171-
dotnet test -c Release
203+
dotnet test -c Debug --logger "console;verbosity=detailed"
172204
shell: bash
173205
working-directory: ${{ github.workspace }}/csharp
174206

@@ -232,7 +264,7 @@ jobs:
232264
run: |
233265
mkdir -p "${{ github.workspace }}/csharp/lib/runtimes/osx-x64/native"
234266
cp "${{ github.workspace }}/build_artifacts/libusearch_c.dylib" "${{ github.workspace }}/csharp/lib/runtimes/osx-x64/native"
235-
dotnet test -c Release
267+
dotnet test -c Debug --logger "console;verbosity=detailed" --filter "FullyQualifiedName!=Cloud.Unum.USearch.Tests.UsearchIndexTests.PersistAndRestore"
236268
shell: bash
237269
working-directory: ${{ github.workspace }}/csharp
238270

@@ -288,7 +320,7 @@ jobs:
288320
run: |
289321
mkdir -p "${{ github.workspace }}\csharp\lib\runtimes\win-x64\native"
290322
cp "${{ github.workspace }}\build_artifacts\libusearch_c.dll" "${{ github.workspace }}\csharp\lib\runtimes\win-x64\native"
291-
dotnet test -c Release
323+
dotnet test -c Debug --logger "console;verbosity=detailed"
292324
shell: bash
293325
working-directory: ${{ github.workspace }}/csharp
294326

@@ -299,7 +331,7 @@ jobs:
299331
- uses: actions/checkout@v4
300332
- run: git submodule update --init --recursive
301333
- name: Build
302-
uses: docker/build-push-action@v4
334+
uses: docker/build-push-action@v6
303335
with:
304336
context: .
305337
load: true

.github/workflows/release.yml

Lines changed: 35 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,44 @@ permissions:
1818

1919
jobs:
2020
versioning:
21-
name: Semantic Release
22-
runs-on: ubuntu-22.04
21+
name: Update Version
22+
runs-on: ubuntu-latest
2323
steps:
24-
- uses: actions/checkout@v4
24+
- name: Checkout
25+
uses: actions/checkout@v4
2526
with:
27+
fetch-depth: 0
2628
persist-credentials: false
27-
- name: Set up Node.js
28-
uses: actions/setup-node@v4
29-
with:
30-
node-version: 20
3129
- name: Set up Cargo
3230
uses: actions-rs/toolchain@v1
3331
with:
3432
toolchain: stable
3533
override: true
36-
- name: Bump version
37-
run: npm install --save-dev --prefix ./package-ci @semantic-release/exec @semantic-release/git conventional-changelog-eslint semantic-release && npx --prefix ./package-ci semantic-release
34+
- name: Run TinySemVer
35+
uses: ashvardanian/[email protected]
36+
with:
37+
verbose: "true"
38+
version-file: "VERSION"
39+
update-version-in: |
40+
package.json:"version": "(\d+\.\d+\.\d+)"
41+
CITATION.cff:^version: (\d+\.\d+\.\d+)
42+
Cargo.toml:^version = "(\d+\.\d+\.\d+)"
43+
wasmer.toml:^version = "(\d+\.\d+\.\d+)"
44+
conanfile.py:version = "(\d+\.\d+\.\d+)"
45+
java/README.md:<version>(\d+\.\d+\.\d+)</version>
46+
README.md:version = {(\d+\.\d+\.\d+)}
47+
csharp/nuget/nuget-package.props:>(\d+\.\d+\.\d+)</Version>
48+
CMakeLists.txt:VERSION (\d+\.\d+\.\d+)
49+
update-major-version-in: |
50+
include/usearch/index.hpp:^#define USEARCH_VERSION_MAJOR (\d+)
51+
update-minor-version-in: |
52+
include/usearch/index.hpp:^#define USEARCH_VERSION_MINOR (\d+)
53+
update-patch-version-in: |
54+
include/usearch/index.hpp:^#define USEARCH_VERSION_PATCH (\d+)
55+
dry-run: "false"
56+
push: "true"
57+
create-release: "true"
58+
github-token: ${{ secrets.SEMANTIC_RELEASE_TOKEN }}
3859

3960
rebase:
4061
name: Rebase Dev. Branch
@@ -469,7 +490,8 @@ jobs:
469490
os:
470491
- macos-latest
471492
- ubuntu-22.04
472-
- windows-latest
493+
# Windows pre-buld is not working
494+
# - windows-latest
473495
exclude:
474496
- arch: x86
475497
os: macos-latest
@@ -614,9 +636,9 @@ jobs:
614636
- name: Pull Git submodules
615637
run: git submodule update --init --recursive
616638
- name: Set up Java
617-
uses: actions/setup-java@v3
639+
uses: actions/setup-java@v4
618640
with:
619-
java-version: "11"
641+
java-version: "21"
620642
distribution: "adopt"
621643
- name: Setup Gradle
622644
uses: gradle/[email protected]
@@ -678,7 +700,7 @@ jobs:
678700
unum/usearch
679701
ghcr.io/${{ github.repository }}
680702
- name: Build and push
681-
uses: docker/build-push-action@v4
703+
uses: docker/build-push-action@v6
682704
with:
683705
context: .
684706
push: true

.github/workflows/update_version.sh

Lines changed: 0 additions & 19 deletions
This file was deleted.

.gitignore

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@ bin
1010
.cache
1111

1212
# C++ builds
13-
build
14-
build_release
15-
build_debug
16-
build_artifacts
13+
/build
14+
/build_release
15+
/build_debug
16+
/build_relwithdebinfo
17+
/build_profile
18+
/build_artifacts
1719
_deps
1820
CMakeCache.txt
1921
CMakeFiles

.vscode/launch.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,19 @@
176176
"datasets/wiki_1M/groundtruth.public.100K.ibin",
177177
],
178178
"justMyCode": true
179+
},
180+
{
181+
"name": "Unit Test C#",
182+
"type": "coreclr",
183+
"request": "launch",
184+
"program": "dotnet",
185+
"args": [
186+
"test",
187+
"-c",
188+
"Debug"
189+
],
190+
"cwd": "${workspaceFolder}/csharp",
191+
"stopAtEntry": false
179192
}
180193
]
181194
}

.vscode/settings.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,8 @@
120120
"xstring": "cpp",
121121
"xtr1common": "cpp",
122122
"xtree": "cpp",
123-
"xutility": "cpp"
123+
"xutility": "cpp",
124+
"execution": "cpp"
124125
},
125126
"cSpell.words": [
126127
"allclose",
@@ -139,6 +140,7 @@
139140
"dtype",
140141
"DUSEARCH",
141142
"emcmake",
143+
"endregion",
142144
"equi",
143145
"equidimensional",
144146
"FAISS",
@@ -151,6 +153,11 @@
151153
"hnswlib",
152154
"ibin",
153155
"jaccard",
156+
"Jemalloc",
157+
"Kullback",
158+
"Leibler",
159+
"libjemalloc",
160+
"libomp",
154161
"libusearch",
155162
"linalg",
156163
"longlong",
@@ -174,10 +181,13 @@
174181
"SLOC",
175182
"Sonatype",
176183
"sorensen",
184+
"Sørensen",
177185
"sqeuclidean",
186+
"stringzilla",
178187
"Struct",
179188
"swar",
180189
"tanimoto",
190+
"tparam",
181191
"tqdm",
182192
"uninitialize",
183193
"unumusearch",

.vscode/tasks.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"tasks": [
44
{
55
"label": "Linux Build Debug",
6-
"command": "cmake -DCMAKE_CXX_COMPILER=gcc-12 -DCMAKE_CXX_COMPILER=g++-12 -DUSEARCH_BUILD_TEST_CPP=1 -DUSEARCH_BUILD_TEST_C=1 -DUSEARCH_BUILD_LIB_C=1 -DUSEARCH_USE_OPENMP=1 -DUSEARCH_USE_SIMSIMD=1 -DUSEARCH_USE_JEMALLOC=1 -DCMAKE_BUILD_TYPE=Debug -B ./build_debug && cmake --build ./build_debug --config Debug",
6+
"command": "cmake -DCMAKE_CXX_COMPILER=gcc-12 -DCMAKE_CXX_COMPILER=g++-12 -DUSEARCH_BUILD_TEST_CPP=1 -DUSEARCH_BUILD_TEST_C=1 -DUSEARCH_BUILD_LIB_C=1 -DUSEARCH_USE_OPENMP=0 -DUSEARCH_USE_SIMSIMD=1 -DUSEARCH_USE_JEMALLOC=1 -DCMAKE_BUILD_TYPE=Debug -B ./build_debug && cmake --build ./build_debug --config Debug",
77
"args": [],
88
"type": "shell",
99
"problemMatcher": [
@@ -12,7 +12,7 @@
1212
},
1313
{
1414
"label": "Linux Build Release",
15-
"command": "cmake -DCMAKE_CXX_COMPILER=gcc-12 -DCMAKE_CXX_COMPILER=g++-12 -DUSEARCH_BUILD_TEST_CPP=1 -DUSEARCH_BUILD_TEST_C=1 -DUSEARCH_BUILD_LIB_C=1 -DUSEARCH_USE_OPENMP=1 -DUSEARCH_USE_SIMSIMD=1 -DUSEARCH_USE_JEMALLOC=1 -DCMAKE_BUILD_TYPE=Release -B ./build_release && cmake --build ./build_release --config RelWithDebInfo",
15+
"command": "cmake -DCMAKE_CXX_COMPILER=gcc-12 -DCMAKE_CXX_COMPILER=g++-12 -DUSEARCH_BUILD_TEST_CPP=1 -DUSEARCH_BUILD_TEST_C=1 -DUSEARCH_BUILD_LIB_C=1 -DUSEARCH_USE_OPENMP=0 -DUSEARCH_USE_SIMSIMD=1 -DUSEARCH_USE_JEMALLOC=1 -DCMAKE_BUILD_TYPE=Release -B ./build_release && cmake --build ./build_release --config RelWithDebInfo",
1616
"args": [],
1717
"type": "shell",
1818
"problemMatcher": [

BENCHMARKS.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -61,19 +61,19 @@ Within this repository you will find two commonly used utilities:
6161
To achieve best highest results we suggest compiling locally for the target architecture.
6262

6363
```sh
64-
cmake -B ./build_release -USEARCH_BUILD_BENCH_CPP=1 -DUSEARCH_BUILD_TEST_C=1 -DUSEARCH_USE_OPENMP=1 -DUSEARCH_USE_SIMSIMD=1
65-
cmake --build ./build_release --config Release -j
66-
./build_release/bench_cpp --help
64+
cmake -USEARCH_BUILD_BENCH_CPP=1 -DUSEARCH_BUILD_TEST_C=1 -DUSEARCH_USE_OPENMP=1 -DUSEARCH_USE_SIMSIMD=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo -B build_profile
65+
cmake --build build_profile --config RelWithDebInfo -j
66+
build_profile/bench_cpp --help
6767
```
6868

6969
Which would print the following instructions.
7070

7171
```txt
7272
SYNOPSIS
73-
./build_release/bench_cpp [--vectors <path>] [--queries <path>] [--neighbors <path>] [-b] [-j
74-
<integer>] [-c <integer>] [--expansion-add <integer>]
75-
[--expansion-search <integer>] [--native|--f16quant|--i8quant]
76-
[--ip|--l2sq|--cos|--haversine] [-h]
73+
build_profile/bench_cpp [--vectors <path>] [--queries <path>] [--neighbors <path>] [-b] [-j
74+
<integer>] [-c <integer>] [--expansion-add <integer>]
75+
[--expansion-search <integer>] [--native|--f16quant|--i8quant]
76+
[--ip|--l2sq|--cos|--haversine] [-h]
7777
7878
OPTIONS
7979
--vectors <path>
@@ -111,12 +111,12 @@ OPTIONS
111111
Here is an example of running the C++ benchmark:
112112

113113
```sh
114-
./build_release/bench_cpp \
114+
build_profile/bench_cpp \
115115
--vectors datasets/wiki_1M/base.1M.fbin \
116116
--queries datasets/wiki_1M/query.public.100K.fbin \
117117
--neighbors datasets/wiki_1M/groundtruth.public.100K.ibin
118118

119-
./build_release/bench_cpp \
119+
build_profile/bench_cpp \
120120
--vectors datasets/t2i_1B/base.1B.fbin \
121121
--queries datasets/t2i_1B/query.public.100K.fbin \
122122
--neighbors datasets/t2i_1B/groundtruth.public.100K.ibin \
@@ -201,17 +201,17 @@ With `perf`:
201201

202202
```sh
203203
# Pass environment variables with `-E`, and `-d` for details
204-
sudo -E perf stat -d ./build_release/bench_cpp ...
205-
sudo -E perf mem -d ./build_release/bench_cpp ...
204+
sudo -E perf stat -d build_profile/bench_cpp ...
205+
sudo -E perf mem -d build_profile/bench_cpp ...
206206
# Sample on-CPU functions for the specified command, at 1 Kilo Hertz:
207-
sudo -E perf record -F 1000 ./build_release/bench_cpp ...
208-
perf record -d -e arm_spe// -- ./build_release/bench_cpp ..
207+
sudo -E perf record -F 1000 build_profile/bench_cpp ...
208+
perf record -d -e arm_spe// -- build_profile/bench_cpp ..
209209
```
210210

211211
### Caches
212212

213213
```sh
214-
sudo perf stat -e 'faults,dTLB-loads,dTLB-load-misses,cache-misses,cache-references' ./build_release/bench_cpp ...
214+
sudo perf stat -e 'faults,dTLB-loads,dTLB-load-misses,cache-misses,cache-references' build_profile/bench_cpp ...
215215
```
216216

217217
Typical output on a 1M vectors dataset is:

CITATION.cff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ authors:
55
given-names: "Ash"
66
orcid: "https://orcid.org/0000-0002-4882-1815"
77
title: "USearch by Unum Cloud"
8-
version: 2.12.0
8+
version: 2.13.0
99
doi: 10.5281/zenodo.7949416
1010
date-released: 2023-10-22
1111
url: "https://github.com/unum-cloud/usearch"

0 commit comments

Comments
 (0)