Oriun / MNIST

Handwritten digits recognition solved with various algorithms for an understanding of artificial intelligence
MIT License
0 stars 0 forks source link

C++ - Knn Multithreading #1

Open Oriun opened 2 years ago

Oriun commented 2 years ago

Implement multithreaded search for nearest neighbors in c++ to compute the algorithm faster.

Oriun commented 2 years ago

Solution

Implemented simple multithreading with std::future and std::async.

Performance

Test

Mesure time for 50 tests on my computer.

Results

Conclusion

Running the search on more than one thread does speed up the process (-49% with 2 threads) but as we add more threads it gets slower. It can be due to the time needed to create the thread (we should try to reuse threads) or the cpu it runs on.