Open Rudxain opened 4 months ago
If I RIIR before this, I should remember that std::thread
can only be emulated by wasm_thread, so WebWorker
s are the only stable way
I expect that WebGL
auto-distributes workload across GPU cores, so there's no need for WebWorker
s to handle slices of the Canvas
, as that would require multiple API calls (counterproductive)
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
WebWorker
s.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