Skip to content

Commit f662d31

Browse files
committed
Merge branch 'goapi' into main-dev
2 parents 8d2a88e + 1d6ae88 commit f662d31

File tree

6 files changed

+1181
-503
lines changed

6 files changed

+1181
-503
lines changed

.github/workflows/prerelease.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ jobs:
244244
- name: Build C/C++
245245
run: |
246246
brew update
247-
brew install cmake
247+
brew reinstall cmake
248248
cmake -B build_artifacts -D CMAKE_BUILD_TYPE=RelWithDebInfo -D USEARCH_BUILD_TEST_CPP=1 -D USEARCH_BUILD_TEST_C=1 -D USEARCH_BUILD_LIB_C=1 -D USEARCH_BUILD_SQLITE=1
249249
cmake --build build_artifacts --config RelWithDebInfo
250250
- name: Test C++

CONTRIBUTING.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,15 @@ cp c/usearch.h golang/ # to make the header available to Go
397397
cd golang && LD_LIBRARY_PATH=. go test -v ; cd ..
398398
```
399399

400+
For static checks:
401+
402+
```sh
403+
cd golang
404+
go vet ./...
405+
staticcheck ./... # if installed
406+
golangci-lint run # if installed
407+
```
408+
400409
## Java
401410

402411
USearch provides Java bindings as a fat-JAR published with prebuilt JNI libraries via GitHub releases. Installation via Maven Central is deprecated; prefer downloading the fat-JAR from the latest GitHub release. The compilation settings are controlled by `build.gradle` and are independent from CMake used for C/C++ builds.

golang/README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,10 @@ func main() {
6464
}
6565
defer index.Destroy()
6666

67-
// Add to Index
67+
// Reserve capacity and configure internal threading
6868
err = index.Reserve(uint(vectorsCount))
69+
_ = index.ChangeThreadsAdd(uint(runtime.NumCPU()))
70+
_ = index.ChangeThreadsSearch(uint(runtime.NumCPU()))
6971
for i := 0; i < vectorsCount; i++ {
7072
err = index.Add(usearch.Key(i), []float32{float32(i), float32(i + 1), float32(i + 2)})
7173
if err != nil {
@@ -82,6 +84,10 @@ func main() {
8284
}
8385
```
8486

87+
Notes:
88+
- Always call `Reserve(capacity)` before the first write.
89+
- Prefer single-caller writes with internal parallelism via `ChangeThreadsAdd` and internal parallel searches via `ChangeThreadsSearch`, instead of calling `Add` concurrently.
90+
8591
3. Get USearch:
8692

8793
```sh

0 commit comments

Comments
 (0)