←back to thread

86 points alexop | 4 comments | | HN request time: 0s | source
1. ashvardanian ◴[] No.43326534[source]
It’s a nice post, but “using array methods” probably shouldn’t be placed in the “Efficient Implementation” section. As often happens with high-level languages, a single plain old loop is faster than three array methods.

Similarly, if you plan to query those vectors in search, you should consider continuous `TypedArray` types and smaller scalars than the double precision `number`.

I know very little about JS, but some of the amazing HackerNews community members have previously helped port SimSIMD to JavaScript (https://github.com/ashvardanian/SimSIMD), and I wrote a blog post covering some of those JS/TS-specifics, NumJS, and MathJS in 2023 (https://ashvardanian.com/posts/javascript-ai-vector-search/).

Hopefully, it should help unlock another 10-100x in performance.

replies(2): >>43327104 #>>43328246 #
2. mariusseufzer ◴[] No.43327104[source]
Oh this is awesome! We actually have a really good use case for this, it should improve performance in our case a lot and help us stay away from WASM a bit longer. Thanks for sharing!
3. jgord ◴[] No.43328246[source]
ooh, fantastic.. thankyou !

Im doing a bunch of 3D rotation transforms on millions of points in javascript .. this looks like what I need.

replies(1): >>43331189 #
4. MrLeap ◴[] No.43331189[source]
I'd probably use gpu.js for something like this.