[Project_owners] intensive recursions in Javascript
eric.jung at yahoo.com
eric.jung at yahoo.com
Mon May 7 13:31:41 PDT 2007
Perhaps if you post your algorithm we can help.
----- Original Message ----
From: Preet Shihn <preetshihn at gmail.com>
To: Mozdev Project Owners List <project_owners at mozdev.org>
Sent: Monday, May 7, 2007 3:14:31 PM
Subject: Re: [Project_owners] intensive recursions in Javascript
I am using Canvas.. I can not use SVG... well not now at least, unless i revamp a whole lot of code.
Filling is easy using canvas at the time you want to draw, but filling later..after it has been drawn requires pixel manipulation, for which I am using the flood fill algorithm.
I guess I can use window.setTimeout but it will just avoid that script dialog to pop-up, but the whole performance issue still exists. I am going to try it and see what performance stats I get.
- Preet
On 5/7/07, Matthew Wilson <matthew at mjwilson.demon.co.uk> wrote:
Preet Shihn wrote:
> Heyas!
>
> I am a semi-javascript newbie. I noticed that Javascript isn't really
> great with long running recursive methods or a long running while loop
> that can be memory intensive.
> I see the browser popup "A script on the page may be busy, or it may
> have stopped responding..... Stop the script or continue". I was
> wondering how people have dealt with this. An example of such a method
> that I was implementing is Flood Fill. Basically, fill a contoor with a
> specified colour.
Can you use SVG or Canvas to avoid the work?
Or use window.setTimeout to split up the work you're doing into chunks?
Matthew
_______________________________________________
Project_owners mailing list
Project_owners at mozdev.org
http://mozdev.org/mailman/listinfo/project_owners
_______________________________________________
Project_owners mailing list
Project_owners at mozdev.org
http://mozdev.org/mailman/listinfo/project_owners
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mozdev.org/pipermail/project_owners/attachments/20070507/22763655/attachment.html
More information about the Project_owners
mailing list