Hi,
i have one performance problem with XML and ListView:
i have XML file with about 12000 nodes (yes, it it very much, but all nodes are necessary). This file has the following structure:
<?xml .... ?>
<MyRootNode>
<node name="name1" lang="en" artist="aaa" genre="dsdsds" dsadasd="dsdsd" />
...
<node name="name12000" lang="en" artist="aaa" genre="dsdsds" dsadasd="dsdsd" />
</MyRootNode>
and then i need load this document into ListView:
XmlDocument Doc = new XmlDocument();
Doc.Load("MyDoc.xml");
string[] SubItems = new string[4];
foreach(XmlNode Node in Doc.DocumentElement.ChildNodes)
{
SubItems[0] = Node.Attributes["lang"].Value;
SubItems[1] = Node.Attributes["artist"].Value;
SubItems[2] = Node.Attributes["genre"].Value;
SubItems[3] = Node.Attributes["dsadasd"].Value
MyListView.Items.Add(Node.Attributes["Name"].Value).SubItems.Add(SubItems);
}
This process takes about 10 seconds and it is too long. Are there any ways to improve performance of such operation? I've tried to use Microsoft Parallel Extensions July 2008 CTP, but it didn't impoved anything, maybe because this operation can not be splitted into 2 separated threads. And where is the largest performance issue in this code?