SERVER-39057 Add distance expressions for image feature comparison #1291
SERVER-39057 Add distance expressions for image feature comparison #1291marcvivet-we wants to merge 3 commits intomongodb:masterfrom
Conversation
|
I think that our implementation still needs some improvements..
Any help is appreciated |
|
What it would be nice to speed up even more these operations would be to have a new function on the Value object that returns the memory aligned: so instead of -> value1.getBinData(); -> value1.getAlignedBinData(); This can be done by changing the memory allocation to __mm_malloc and __mm_free (alignment of 32bits). This would allow us to use _mmXXX_load_ps instead of _mmXXX_loadu_ps. |
|
Hi @marcvivet-we, Thanks so much for opening this pull request! It looks like a really interesting and worthwhile extension. I see you've already signed the contributor's agreement, so I've gone ahead and created SERVER-39057 to track this issue on your behalf. The query team will look over the pull request and provide more substantive comments. Thanks again, |
| @@ -309,6 +309,27 @@ ExitCode _initAndListen(int listenPort) { | |||
| l << (is32bit ? " 32" : " 64") << "-bit host=" << getHostNameCached() << endl; | |||
There was a problem hiding this comment.
Can you explain what is your intention @anhems with this line?
Seems completely unrelated to this PR,
Best,
Miguel
We added these expressions:
Which allow us to compare long vectors (image features) stored as arrays or BSON.
It is useful to find the most similar images in a dataset. The usage is the following:
In addition implementations using avx2 and avx512 are included in this pull request.