usearch 0.4.0 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/.clang-tidy +60 -0
  2. package/.github/workflows/release.yml +42 -16
  3. package/.github/workflows/update_version.sh +1 -0
  4. package/.vscode/launch.json +22 -0
  5. package/.vscode/settings.json +5 -0
  6. package/.vscode/tasks.json +4 -4
  7. package/CITATION.cff +11 -0
  8. package/CMakeLists.txt +108 -95
  9. package/Cargo.toml +1 -1
  10. package/Dockerfile +14 -0
  11. package/README.md +8 -7
  12. package/VERSION +1 -1
  13. package/binding.gyp +2 -2
  14. package/build.rs +2 -2
  15. package/cmake/config.cmake.in +15 -0
  16. package/cmake/pkg-config.pc.in +4 -0
  17. package/cmake/usearchConfigVersion.cmake.in +20 -0
  18. package/conanfile.py +1 -1
  19. package/docs/benchmarks.md +11 -2
  20. package/docs/{Compilation.md → compilation.md} +54 -27
  21. package/include/usearch/usearch.hpp +664 -390
  22. package/java/cloud/unum/usearch/cloud_unum_usearch_Index.cpp +17 -16
  23. package/javascript/lib.cpp +13 -13
  24. package/javascript/test.js +1 -1
  25. package/objc/USearchObjective.mm +46 -29
  26. package/objc/include/USearchObjective.h +18 -26
  27. package/package.json +1 -1
  28. package/pyproject.toml +3 -2
  29. package/python/lib.cpp +179 -120
  30. package/python/scripts/bench.py +188 -0
  31. package/python/scripts/bench_params.py +113 -0
  32. package/python/{test.py → scripts/test.py} +32 -13
  33. package/python/usearch/client.py +100 -14
  34. package/python/usearch/server.py +104 -23
  35. package/rust/lib.cpp +15 -14
  36. package/rust/lib.hpp +5 -5
  37. package/rust/lib.rs +3 -3
  38. package/setup.py +7 -0
  39. package/src/CMakeLists.txt +107 -0
  40. package/src/bench.cpp +45 -15
  41. package/src/{advanced.hpp → punned.hpp} +227 -199
  42. package/src/test.cpp +62 -0
  43. package/swift/Test.swift +1 -1
  44. package/wolfram/lib.cpp +14 -14
  45. package/python/bench.py +0 -146
@@ -1,65 +1,86 @@
1
1
  # Compiling USearch
2
2
 
3
- ## Build
4
-
5
3
  Before building the first time, please pull submodules.
6
4
 
7
5
  ```sh
8
6
  git submodule update --init --recursive
9
7
  ```
10
8
 
11
- ### Linux
9
+ ## C++
10
+
11
+ Linux:
12
12
 
13
13
  ```sh
14
14
  cmake -B ./build_release \
15
15
  -DCMAKE_CXX_COMPILER="g++-12" \
16
16
  -DCMAKE_BUILD_TYPE=Release \
17
+ -DUSEARCH_USE_JEMALLOC=1 \
17
18
  -DUSEARCH_USE_OPENMP=1 \
18
- -DUSEARCH_USE_JEMALLOC=1 && \
19
+ -DUSEARCH_USE_SIMSIMD=1 \
20
+ -DUSEARCH_BUILD_BENCHMARK=1 \
21
+ -DUSEARCH_BUILD_TEST=1 \
22
+ && \
19
23
  make -C ./build_release -j
24
+ ```
25
+
26
+ MacOS:
27
+
28
+ ```sh
29
+ brew install libomp llvm
30
+ cmake -B ./build_release \
31
+ -DCMAKE_C_COMPILER="/opt/homebrew/opt/llvm/bin/clang" \
32
+ -DCMAKE_CXX_COMPILER="/opt/homebrew/opt/llvm/bin/clang++" \
33
+ -DUSEARCH_USE_OPENMP=1 \
34
+ -DUSEARCH_USE_SIMSIMD=1 \
35
+ -DUSEARCH_BUILD_BENCHMARK=1 \
36
+ -DUSEARCH_BUILD_TEST=1 \
37
+ && \
38
+ make -C ./build_release -j
39
+ ```
40
+
41
+ Benchmarking:
20
42
 
21
- # To benchmark in C++:
43
+ ```sh
22
44
  ./build_release/bench \
23
45
  --vectors datasets/wiki_1M/base.1M.fbin \
24
46
  --queries datasets/wiki_1M/query.public.100K.fbin \
25
47
  --neighbors datasets/wiki_1M/groundtruth.public.100K.ibin
26
48
 
27
- # Large benchmark on a 1TB dataset:
28
49
  ./build_release/bench \
29
50
  --vectors datasets/t2i_1B/base.1B.fbin \
30
51
  --queries datasets/t2i_1B/query.public.100K.fbin \
31
52
  --neighbors datasets/t2i_1B/groundtruth.public.100K.ibin \
32
53
  --output datasets/t2i_1B/index.usearch \
33
54
  --cos
55
+ ```
34
56
 
35
- # To benchmark in Python:
36
- python python/bench.py \
37
- --vectors datasets/wiki_1M/base.1M.fbin \
38
- --queries datasets/wiki_1M/query.public.100K.fbin \
39
- --neighbors datasets/wiki_1M/groundtruth.public.100K.ibin
57
+ ## Python
58
+
59
+ ```sh
60
+ pip install -e .
61
+ pytest python/scripts/test.py
40
62
  ```
41
63
 
42
- ### MacOS
64
+ Benchmarking:
43
65
 
44
66
  ```sh
45
- brew install libomp llvm
46
- cmake \
47
- -DCMAKE_C_COMPILER="/opt/homebrew/opt/llvm/bin/clang" \
48
- -DCMAKE_CXX_COMPILER="/opt/homebrew/opt/llvm/bin/clang++" \
49
- -DUSEARCH_USE_SIMD=1 \
50
- -DUSEARCH_USE_OPENMP=1 \
51
- -B ./build_release && \
52
- make -C ./build_release -j
67
+ pip install faiss-cpu
68
+ python python/scripts/bench.py \
69
+ --vectors datasets/wiki_1M/base.1M.fbin \
70
+ --queries datasets/wiki_1M/query.public.100K.fbin \
71
+ --neighbors datasets/wiki_1M/groundtruth.public.100K.ibin
53
72
  ```
54
73
 
55
- ### Python
74
+ > Optional parameters include `connectivity`, `expansion_add`, `expansion_search`.
75
+
76
+ Checking the effect of different embedding dimensions on construction speed:
56
77
 
57
78
  ```sh
58
- pip install -e .
59
- pytest python/test.py
79
+ python python/scripts/bench_params.py dimensions
80
+ python python/scripts/bench_params.py connectivity
60
81
  ```
61
82
 
62
- ### JavaScript
83
+ ## JavaScript
63
84
 
64
85
  ```sh
65
86
  npm install
@@ -67,14 +88,14 @@ node javascript/test.js
67
88
  npm publish
68
89
  ```
69
90
 
70
- ### Rust
91
+ ## Rust
71
92
 
72
93
  ```sh
73
94
  cargo test -p usearch
74
95
  cargo publish
75
96
  ```
76
97
 
77
- ### Java
98
+ ## Java
78
99
 
79
100
  ```sh
80
101
  gradle clean build
@@ -105,8 +126,14 @@ java -cp . -Djava.library.path=/Users/av/github/usearch/java/cloud/unum/usearch/
105
126
  java -cp . -Djava.library.path=/Users/av/github/usearch/java cloud.unum.usearch.Index
106
127
  ```
107
128
 
108
- ### Wolfram
129
+ ## Wolfram
109
130
 
110
131
  ```sh
111
132
  brew install --cask wolfram-engine
112
133
  ```
134
+
135
+ ## Docker
136
+
137
+ ```sh
138
+ docker build -t unum/usearch . && docker run unum/usearch
139
+ ```