Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Apart from algorithm commentary by folks who are certainly wiser than me on the topic: since you’re already using a worker, you would probably benefit from using OffscreenCanvas[0], which is transferrable to worker threads and otherwise should be optimized for heavier computations.

0: https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCa...



Thanks for the suggestion. I did indeed achieve a significant speed up with OffscreenCanvas, see the commit below. It lets me avoid the slowest part of my original solution, the call to context.putImageData()

https://github.com/shaneosullivan/example-canvas-fill/commit...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: