Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / XML / March 2007

Tip: Looking for answers? Try searching our database.

Fastest way to load an xml file into an array in .net

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jörgen Ahrens - 08 Mar 2007 08:17 GMT
Hi All

VS 2005 SP1 (C#, VB.NET)

I need the absolut fastest way of loading an xml-file of about 700KB into an
array.

I need to load about 1500 of those xml-Files into arrays on startup of my
application.
Therefore it needs to be as fast as possible.
Please also tell me if the xml structure can be improved.

the xml looks like:
y: Year
m: Month
h: Hour
value

<data>
 <v y="1998" m="1" h="1">0.227777109151971</v>
 <v y="1998" m="1" h="2">0.206573903224972</v>
 <v y="1998" m="1" h="3">0.165140219440699</v>
 <v y="1998" m="1" h="4">0.124293431158821</v>
 <v y="1998" m="1" h="5">0.104002798378086</v>
 <v y="1998" m="1" h="6">0.0812389501473294</v>
 <v y="1998" m="1" h="7">0.0136806566150509</v>
 <v y="1998" m="1" h="8">0.0607339108863059</v>
 <v y="1998" m="1" h="9">0.111394621283997</v>
 <v y="1998" m="1" h="10">0.168801709563907</v>
 <v y="1998" m="1" h="11">0.0865607844888258</v>
 <v y="1998" m="1" h="12">0.101389182210782</v>
 <v y="1998" m="1" h="13">0.204044532248796</v>
 <v y="1998" m="1" h="14">0.157314882488258</v>
 <v y="1998" m="1" h="15">0.121055145349667</v>
 <v y="1998" m="1" h="16">0.102359195578094</v>
 <v y="1998" m="1" h="17">0.0199985034684297</v>
 <v y="1998" m="1" h="18">0.107776377100517</v>
 <v y="1998" m="1" h="19">0.140707273209167</v>
 <v y="1998" m="1" h="20">0.116934362505389</v>
 <v y="1998" m="1" h="21">0.181578399407852</v>
 <v y="1998" m="1" h="22">0.162783178544661</v>
 <v y="1998" m="1" h="23">0.248914944436437</v>
 <v y="1998" m="1" h="24">0.201314812545552</v>
 <v y="1998" m="2" h="1">0.169468199288149</v>
...
 <v y="2050" m="12" h="24">-0.930491278500616</v>
</data>

Thanks for your help

jahrens
Martin Honnen - 08 Mar 2007 13:01 GMT
> VS 2005 SP1 (C#, VB.NET)
>
> I need the absolut fastest way of loading an xml-file of about 700KB into an
> array.

Use XmlReader to pull in the data. Your code will need to push the data
the XmlReader delivers into an array.

Signature

    Martin Honnen --- MVP XML
    http://JavaScript.FAQTs.com/

WenYuan Wang - 09 Mar 2007 07:31 GMT
Yes, XmlReader provides fast, non-cached, forward-only access to XML data.

Hope this helps.
Sincerely,
Wen Yuan
WenYuan Wang - 13 Mar 2007 12:16 GMT
Hi Jahrens,

Just want to check whether the issue has been resolved.
If you have met any further issue, please feel free to update.
I'm glad to assist you.

Have a great day,
Sincerely,
Wen Yuan
Jörgen Ahrens - 15 Mar 2007 13:42 GMT
Hi Wen Yuan

we changed everthing to a binary format...much faster and smaller.

thanks for the help anyway.
jahrens

> Hi Jahrens,
>
[quoted text clipped - 5 lines]
> Sincerely,
> Wen Yuan

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.