Hi,
I am using the control Infragistics.Win.UltraWinTree.UltraTree to display xml nodes in to the GUI.and using object of the class Infragistics.Win.UltraWinTree.UltraTreeNode to add child nodes and siblings their parent nodes to display into GUI.
I am using object of the class System.xml.XmlDocument to load XML file.
If data(properties) of particular node will be storing into structure array for later point of use. For example : Element properties: Name, Type, MatchCreterion, DataStruct, Mandatory, Return are storing into structure object array. and will use laterEg: <ElementList> <Element> <Name>MSC</Name> <Type>String</Type> <MatchCreterion>Prefix</MatchCreterion> <DataStruct /> <Mandatory>True</Mandatory> <Return>Yes</Return> </Element> <Element> <Name>SME</Name> <Type>String</Type> <MatchCreterion>Prefix</MatchCreterion> <DataStruct /> <Mandatory>True</Mandatory> <Return>Yes</Return> </Element> </ElementList>Using for loop to add child nodes to their parent node. (Creating TreeNode objects and adding into their parent nodes).
Issue is Here:
If I am trying to load 10 MB xml file, it is taking 20 minutes time to load that file and CPU usage 100% for loading that file. After that system is becoming very slow.
Please provide the solution.
Its very important for my application.
Thank you for your time.
RegardsPrathap Reddy U
I attached test project with this reply. 10 MB xml file is located in application path(bin folder). Please execute the project and check the same. Please check the code also. Please give any better idea to solve this performance issue.
Softwares Used:
Dot Net Framework 2.0 and NetAdvantageWinClient20092_Trial and Vb.Net
Regards
Prathap
Hi Prathap.
prathap_u said:Could you please provide any sample project demonstrating the performance?
I really don't see how I could provide you with any useful sample of this, since I cannot anticipate the needs of your application. If you can duplicate a performance problem in a small sample project, I'd be happy to take a look at it. But other than the existing samples, I'm afraid I can't write a custom sample to demonstrate how to avoid an issue whose cause is unknown.
prathap_u said:One more question is it possible to display processed data into UltraTree control while processing large XML(Using Threads). So End user can able to navigate between GUI screens until the whole file is processed.
This might be possible, but it's extremely dangerous and I would not recommend it. Using threads to load data is very complex and difficult and if you do not marshal the data properly in every case, you could end up with random crashes in your application that are very difficult if not impossible to debug.
My experience is:
Use NEVER (NEVER NEVER NEVER!) any overload of Nodes.Add that returns a UltraTreeNode.
Create first a UltraTreeNode:
var newNode = new UltraTreeNode("key","caption");
then set your values appearances, properties, whatever.
For images: Never assign the imageindex of an imagelist to an appearance-object always set the image direct e.g. NodeAppearance.Image = imagelist.Images[1]
Adding the new node to the parents nodes collection should always be the last step (Nodes.Add(newNode);).
If you must do a lot of Inserts (Nodes.Insert) you're lost. There is no overload of Insert that accepts an UltraTreeNode
Hope that helps
Oliver
Thank you for your reply.
Could you please provide any sample project demonstrating the performance?
One more question is it possible to display processed data into UltraTree control while processing large XML(Using Threads). So End user can able to navigate between GUI screens until the whole file is processed.
Example: Open 50 MB XML file from Browser. End user can able to move up and down while it is processing/loading.
Thanks and Regards
Prathap.
Hi Prathap,
In that case, we will need you to provide a small sample project demonstrating the performance issue so we can determine the cause.