5 ms·
There's no reason a JIT'd runtime is going to find this job challenging or slow at all. I don't know what OP's original code is but maybe OP was calling a Canv
by thrashh 3y ago
There's no reason a JIT'd runtime is going to find this job challenging or slow at all.
I don't know what OP's original code is but maybe OP was calling a Canvas API method for every pixel (super bad).
- shaneos 3y agoI wasn’t calling per pixel :-) even when just visiting each pixel once it would still take 50 - 100ms to fill a large image which the user perceives as lag. I wanted it to be instant
- johnfn 3y agoI've tried writing a fast flood fill in JS and it's a lot more challenging than you and GP make it out to be. If it's really so straightforward, you should produce code. Otherwise, these comments don't add much to the discussion.
- kragen 3y agoi'd be surprised if someone could do it within the editing window for an hn comment, but it doesn't seem like more than a day or two of work for double-digit megapixel fill rates