in reply to Foreach Loop Optimization
This may be beating a dead horse, because others have pointed this out, but IMHO, it's important that you understand that between your js (onClick), your 800 row table, and your omission of (at least) a "width" value for your table and its cells, you've assigned a lot of computations to your browser.
Just as one example, your <td align="center"> won't let the browser even begin to caluclate where the "center" is until it's evaled the whole table, because it doesn't know how wide the table itself or the cell should be (they're dynamic values when not specified) until it has all the data in hand.
Try, for example, a static 800 row table, on your local machine (pure html, no Perl, no js and using widths); then try again without a width value and with your javascript. I think you'll be amazed at the time required for the browser's rendering engine to do its work, even in the first case, and more so in the second.
In other words, while it would be unfair (oversimplified) to assign all of the time required for you to observe the output to the browser, MUCH of that time is consumed by the browser.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Foreach Loop Optimization
by upallnight (Sexton) on Aug 01, 2007 at 21:43 UTC | |
by ww (Archbishop) on Aug 01, 2007 at 22:33 UTC |