perfomance issues of dynamically removing node from document

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jambalapamba
    New Member
    • Nov 2007
    • 23

    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.st yle.visibility == "hidden" )
    {

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

    }
    }

    the for loop is taking more than 7 seconds for a relatively big document(not huge)
Working...