Crates.io | bfes |
lib.rs | bfes |
version | 0.1.0 |
source | src |
created_at | 2022-06-22 21:21:19.754847 |
updated_at | 2022-06-22 21:21:19.754847 |
description | Brute force embedding (vector) search library |
homepage | |
repository | https://github.com/spullara/bfes |
max_upload_size | |
id | 611154 |
size | 24,620 |
Given a set of embeddings, and a query embedding, this algorithm searches for the nearest embeddings for each query. As it is a brute force search, you don't need to regenerate the index and can add new embeddings to the index at any time. The algorithm is O(n) in time and space.
Time to brute force search 100,000 512-dimensional embeddings:
Windows 11, AMD Ryzen 9 5950x @ 3.4 GHz
test tests::bench_cosine_similarity ... bench: 20,018,120 ns/iter (+/- 2,042,521)
Mac OS X, M1 Max MacbookPro18,4
test tests::bench_cosine_similarity ... bench: 11,302,216 ns/iter (+/- 185,505)
Mac OS X, M1 Macmini9,1
test tests::bench_cosine_similarity ... bench: 9,559,170 ns/iter (+/- 592,620)
Ubuntu 18.04, AWS c6i.large
test tests::bench_cosine_similarity ... bench: 25,452,715 ns/iter (+/- 848,001)
Ubuntu 22.04, AWS c6a.large
test tests::bench_cosine_similarity ... bench: 17,306,132 ns/iter (+/- 78,319)
Ubuntu 22.04, AWS c6g.medium
test tests::bench_cosine_similarity ... bench: 30,262,326 ns/iter (+/- 64,509)