Crates.io | ru_annoy |
lib.rs | ru_annoy |
version | 0.1.3 |
source | src |
created_at | 2019-05-09 16:42:13.317529 |
updated_at | 2021-03-04 17:13:55.713848 |
description | A rust implementation of annoy(https://github.com/spotify/annoy) (Index serving only). Providing C api as well |
homepage | |
repository | https://github.com/hanabi1224/RuAnnoy |
max_upload_size | |
id | 133105 |
size | 186,308 |
This library is a rust port of spotify/annoy , currently only index serving is supported.
# Cargo.toml
[dependencies]
ru_annoy = "0"
use ru_annoy::*;
let index = AnnoyIndex::load(10, "index.ann", IndexType::Angular).unwrap();
let v0 = index.get_item_vector(0);
let nearest = index.get_nearest(v0.as_ref(), 5, -1, true);
It uses JNI bindings to rust crate and is ~5-10x faster than pure java implementation in benchmark scenario
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
dependencies {
implementation 'com.github.hanabi1224:RuAnnoy:<tag>'
}
val index = AnnoyIndex.tryLoad("index.5d.ann", 5, IndexType.Angular)
Runtimes | Nuget package |
---|---|
RuAnnoy | |
RuAnnoy-Batteries-Windows-x64 | |
RuAnnoy-Batteries-Linux-x64 | |
RuAnnoy-Batteries-Darwin-x64 |
<ItemGroup>
<PackageReference Include="RuAnnoy" Version="*" />
<PackageReference Include="RuAnnoy-Batteries-Windows-x64" Version="*" />
</ItemGroup>
var index = AnnoyIndex.Load("index.5d.ann", 5, IndexType.Angular);