blenderskool / pigmnts

🎨 Color palette generator from an image using WebAssesmbly and Rust
https://pigmnts.web.app
MIT License
73 stars 4 forks source link

Use threads for data parallelism #28

Closed blenderskool closed 3 years ago

blenderskool commented 3 years ago

K-means (and K-means++) involve a lot of synchronous tasks which makes it difficult to achieve task parallelism. However, data parallelism may be achieved to improve the performance of certain areas in the process. MapReduce technique can be applied as a starting point in the Assignment step of the algorithm.

For the time being, this could be implemented using native std::thread and WebAssembly support can be thought of a little later once any improvements using threads are observed.