[jboss-dev-forums] [Design of JBoss Portal] - Slow loop in dyna.js

nystaa do-not-reply at jboss.com
Sun Sep 2 08:13:00 EDT 2007


I`m updating a window's content with about 500 table rows with partial-refresh and IE7 popped up a question if I wish to abort the running script because its is slowing the system.

While debugging the algorithm that applies the new content this loop was taking the most time in dyna.js

        // Move src non attribute children to the destination
        while (src.hasChildNodes())
        {
           var srcChild = src.firstChild;
           if (srcChild.nodeType != 2)
           {
              dst.appendChild(srcChild);
           }
           else
           {
              src.removeChild(srcChild);
           }
        }

maybe an alternate implementation with innerHTML will be faster?


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4080292#4080292

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4080292



More information about the jboss-dev-forums mailing list