This content has been marked as final.
Show 8 replies
-
1. Re: Aviod For Loop
kglad Nov 15, 2007 6:36 AM (in response to AScracker)don't use one for-loop. break it into several for-loops that allow the stage to be updated between the various for-loops. -
2. Re: Aviod For Loop
joeflashTO Nov 15, 2007 6:38 AM (in response to AScracker)I am not too sure what you mean by "emp name." Please clarify.
It sounds like you have some characters in an XML file that need to be reparsed, i.e. converted before the data can become usable, and you're saying that this XML parsing is slowing down your application? Unless you've got over 20,000 entries, I doubt parsing alone will introduce a significant delay, so the problem might be in your code, maybe you're attempting to use recursive functions and things are getting locked in a loop? Also, post a bit of code using the Attach Code button, and let's see what you're looking at. -
3. Re: Aviod For Loop
AScracker Nov 15, 2007 9:26 PM (in response to joeflashTO)Hi
This is the structure i am using in my code..
how could i solve this issue...
~~Sk -
-
5. Aviod For Loop
Greg Dove Nov 16, 2007 12:34 AM (in response to AScracker)I suspect its not the for loop that's slow. It could be the original parsing or the XPath filtering. -
6. Re: Aviod For Loop
AScracker Nov 16, 2007 2:56 AM (in response to kglad)Hi
Kglad ,very nice way of coding... but i am facing some problem in implemetion the code....
bcoz, i need to attach the code in Action Script file
~~Sk -
7. Aviod For Loop
Greg Dove Nov 16, 2007 4:14 AM (in response to AScracker)This part doesn't seem to make sense to me:
var __SeatingDetails:XML = new XML();
__SeatingDetails.parseXML(details);
I would think that all you need is :
__SeatingDetails=details;
For the timing parts.... if I were you I would double check that the problem is really with your loop by wrapping some of the key things you're doing with getTimer() checks to be certain which part is the real bottleneck.
Here's an example for me, using a 3 year old laptop (that badly needs replacing). It took around 17 ms to process the 700 nodes in the way that you're doing.
I would check
a) xml loadTime
b) xml parsing Time (optional:you could do this by using onData if you want to and then calling onLoad)
c) xpath.selectNodes
d) looping for string creation and array.push
-
8. Re: Aviod For Loop
AScracker Nov 16, 2007 6:42 AM (in response to kglad)Hi
Kglad i'm facing some problem impleming your code to my file...
1) this.startInd is less than endIndex means then it moves to else function and call the forLoopFfunction
but it's move the else function after than it's not pass the parameter
forLoopF(this.startInd, this.endInd, node_xml);



