News for hackers. Stuff that matters.
Re:Instant flood fill with HTML Canvas by thrashh on Tuesday May 23, 2023 @05:47PM (#36051273)
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).

Re:Instant flood fill with HTML Canvas by shaneos on Tuesday May 23, 2023 @06:08PM (#36051451)
I 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
Re:Instant flood fill with HTML Canvas by johnfn on Tuesday May 23, 2023 @09:45PM (#36053062)
I'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.
Re:Instant flood fill with HTML Canvas by kragen on Tuesday May 23, 2023 @11:38PM (#36053788)
i'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