Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ jobs:
- name: Build C/C++
run: |
brew update
brew install cmake
brew reinstall cmake
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
cmake --build build_artifacts --config RelWithDebInfo
- name: Test C++
Expand Down
9 changes: 9 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,15 @@ cp c/usearch.h golang/ # to make the header available to Go
cd golang && LD_LIBRARY_PATH=. go test -v ; cd ..
```

For static checks:

```sh
cd golang
go vet ./...
staticcheck ./... # if installed
golangci-lint run # if installed
```

## Java

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.
Expand Down
8 changes: 7 additions & 1 deletion golang/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,10 @@ func main() {
}
defer index.Destroy()

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

Notes:
- Always call `Reserve(capacity)` before the first write.
- Prefer single-caller writes with internal parallelism via `ChangeThreadsAdd` and internal parallel searches via `ChangeThreadsSearch`, instead of calling `Add` concurrently.

3. Get USearch:

```sh
Expand Down
Loading
Loading