Rudxain / RGB-digital-rain

The Matrix "falling code/letter rain" animation but RGB. No more monochromatic green!
https://rudxain.github.io/RGB-digital-rain/
GNU Affero General Public License v3.0
14 stars 3 forks source link

parallelization #47

Open Rudxain opened 4 months ago

Rudxain commented 4 months ago

Right now, the main thread isn't the bottleneck, it's the API. But when users are allowed to set droplet speed, we'll need WebWorkers.

I'll have to benchmark before doing so, as the context API calls may be I/O bound rather than CPU-bound. Especially considering that droplets are rendered by repeatedly drawing individual chars, rather than drawing batches of chars

Rudxain commented 4 months ago

If I RIIR before this, I should remember that std::thread can only be emulated by wasm_thread, so WebWorkers are the only stable way

Rudxain commented 4 months ago

I expect that WebGL auto-distributes workload across GPU cores, so there's no need for WebWorkers to handle slices of the Canvas, as that would require multiple API calls (counterproductive)