GithubHelp home page GithubHelp logo

Comments (9)

jakubfiala avatar jakubfiala commented on July 21, 2024

Hi, thanks for letting me know! Does this happen on both Chrome and FF then? What versions of both are you using? Which OS?

You might have noticed that this feature was added literally a few moments ago, so it's possible there are still bugs. However, I can't replicate this on Chrome or FF. Also, since it happens immediately after you switch the mode, it's probably not related to the filling algorithm itself, which is good.

from atrament.

bradmartin avatar bradmartin commented on July 21, 2024

Yea I noticed the update. It happens on both, FireFox does return the "unresponsive script" error dialog.
ffdemo

Windows 10
Chrome = Version 49.0.2623.112 m
FireFox = 43.0.1 && 44.0.2 && 45.0.2 (it's been awhile since I've used FF so I tested, updated, tested and updated each version 😄 )

from atrament.

jakubfiala avatar jakubfiala commented on July 21, 2024

Hmm I've got the same versions, too, so this must be a platform-specific issue. Unfortunately I don't have access to a PC. Would you be able to build the lib from the source, and perhaps do some console logs to see where it breaks?

If not, I can get hold of a PC at some point, it just won't be today I'm afraid.

Also, do you not actually click on the canvas when it happens? It seems very unlikely that the script would freeze by just setting the mode variable.

from atrament.

bradmartin avatar bradmartin commented on July 21, 2024

I'll try to run the source and do some logging and profiling if possible. Might be later today. I'll let you know if I find anything 👍

Just changing the mode seems to lock it up.

from atrament.

ptkach avatar ptkach commented on July 21, 2024

I checked it on PC in Chrome and FF and if you try to fill whole canvas JS thread locks UI for a 5-7 seconds. In Mac it's faster ~ 3-4 sec.

@jakubfiala I reverted my local version to commit I did first on bucket filling and in Chrome on Mac it takes kinda 0.5 sec for a whole canvas filling, on PC ~ 1sec.

Will go deeper to understand what change makes it lag

from atrament.

jakubfiala avatar jakubfiala commented on July 21, 2024

@ptkach that's good to know. In the future we'll be able to pass ImageData to a Web Worker so the JS thread doesn't freeze at all, but who knows when that will get 100% browser support.

One thing I did change in my modifications was that each colorPixel operation also performs two extra matchColor checks and potentially colors the two neighboring pixels, so that could be part of the problem.

In any case, what @bradmartin is experiencing seems like a different issue.

from atrament.

ptkach avatar ptkach commented on July 21, 2024

I think it makes sense to check with my changes. Now it should be several times faster (< 1sec on PC).

from atrament.

jakubfiala avatar jakubfiala commented on July 21, 2024

@bradmartin #6 is now merged to both master and gh-pages, so you should be able to test this problem with the demo.

from atrament.

bradmartin avatar bradmartin commented on July 21, 2024

Much better 👍

from atrament.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.