Skip to content

VWDictionary: use multi-core FLANN kNN search - #1760

Merged
matlabbe merged 9 commits into
introlab:masterfrom
torjusti:flann-multicore-pr
Sep 11, 2026
Merged

matlabbe merged 9 commits into
introlab:masterfrom
torjusti:flann-multicore-pr

Conversation

@torjusti

@torjusti torjusti commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

This PR enabled multi threaded knnSearch when searching in the dictionary. On my machine it gives a modest speedup to rtabmap-reprocess.

Some data when reprocessing 8000 nodes of a database, 500 SuperPoint features per node (times are only for the search step):

Dictionary size cores=1 cores=all Speedup
<50k 7.4 ms 0.78 ms ~9×
50–200k 12.7 ms 1.13 ms ~11×
200–500k 16.7 ms 1.34 ms ~12×
500k–1M 20.0 ms 1.55 ms ~13×
≥1M 23.6 ms 1.87 ms ~13×

Overall: 20.1 to 1.60 ms/node on average (~12.5×)

Synthetic benchmark across different dictionaries and feature counts:

Dictionary Dim cores=1 cores=4 cores=all Speedup
100k 128 5.5 ms 1.9 ms 0.45 ms ~12×
100k 256 6.8 ms 2.0 ms 0.61 ms ~11×
500k 128 8.0 ms 2.3 ms 0.72 ms ~11×
500k 256 10.2 ms 2.9 ms 0.95 ms ~11×

No parameter currently, it defaults to max threads. Happy to change it to be a parameter if wanted.

Comment thread corelib/src/VWDictionary.cpp Resolved
Comment thread corelib/src/FlannIndex.cpp Resolved
@matlabbe

Copy link
Copy Markdown
Member

Not sure what is the deal with the windows tests failing, I'll take care of that. Otherwise, the PR looks good to me.

@matlabbe
matlabbe merged commit 2fbbe19 into introlab:master Sep 11, 2026
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants