469,604 Members | 2,381 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,604 developers. It's quick & easy.

perfomance issues of dynamically removing node from document

Hi

I am removing node from a document depending on the style property and this is taking 7 seconds for checking complete document is there any ideas how can i improve the perfomance. Here is my part of code

foreach (IHTMLElement tempElement in document.all)
{
if (tempElement.style.visibility == "hidden" )
{

IHTMLDOMNode node = tempElement as IHTMLDOMNode;
node.parentNode.removeChild(node);

}
}

the for loop is taking more than 7 seconds for a relatively big document(not huge)
Dec 19 '07 #1
0 890

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

10 posts views Thread by Free-Ed, Ltd. | last post: by
11 posts views Thread by Thomas | last post: by
2 posts views Thread by Raja Kannan | last post: by
7 posts views Thread by ezmiller | last post: by
omerbutt
20 posts views Thread by omerbutt | last post: by
reply views Thread by guiromero | last post: by
reply views Thread by devrayhaan | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.