News for hackers. Stuff that matters.
Re:Comparing Rust and JavaScript by wdroz on Friday July 15, 2022 @08:35AM (#32107436)
It's nice to see how much faster is wasm. This kind of problem would also be nice for parallelization. What's the state of multi-threading wasm? any advantage over javascript web workers?
Re:Comparing Rust and JavaScript by hajile on Friday July 15, 2022 @10:31AM (#32108577)
https://webassembly.org/roadmap/

Atomics have universal support in modern browsers.

This is primarily a single-threaded problem. Each x and y update depends directly on the previous x and y values with the x and y being used to update pixels.

At most (barring changes to the algorithm), it looks like you could calculate these on one thread and update the image on another thread.

Re:Comparing Rust and JavaScript by jcl on Friday July 15, 2022 @02:40PM (#32111415)
It’s true that the problem of generating the exact same image seems to be a single-threaded problem. But I suppose the general problem of rendering an approximation of a strange attractor could be parallelized by generating images from several different starting positions and combining them.