473,385 Members | 1,396 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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

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
Mar 8 '07 #1
4 5586
Jörgen Ahrens wrote:
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.

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Mar 8 '07 #2

Yes, XmlReader provides fast, non-cached, forward-only access to XML data.

Hope this helps.
Sincerely,
Wen Yuan

Mar 9 '07 #3
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

Mar 13 '07 #4
Hi Wen Yuan

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

thanks for the help anyway.
jahrens

""WenYuan Wang"" <v-******@online.microsoft.comwrote in message
news:iI**************@TK2MSFTNGHUB02.phx.gbl...
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

Mar 15 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: richard.pasco | last post by:
Hey all I am trying to write a script that allows users to search through a database of names. But rather than give a search string and then return all those that match, I would like it to...
0
by: chad kline | last post by:
i have searched around for an answer to this question, but haven't found a satisfactory answer. i understand things like mmap(2) can be used to quickly load a file - but it seems to be a...
11
by: Ignacio X. Domínguez | last post by:
Hi. I'm developing a desktop application that needs to store some data in a local file. Let's say for example that I want to have an address book with names and phone numbers in a file. I would...
60
by: Julie | last post by:
What is the *fastest* way in .NET to search large on-disk text files (100+ MB) for a given string. The files are unindexed and unsorted, and for the purposes of my immediate requirements, can't...
11
by: hoopsho | last post by:
Hi Everyone, I am trying to write a program that does a few things very fast and with efficient use of memory... a) I need to parse a space-delimited file that is really large, upwards fo a...
5
by: Tales Normando | last post by:
The title says it all. Anyone?
5
by: Gaurav - http://www.gauravcreations.com | last post by:
what is the fastest method to sort and load 1 lakh + strings in a list box from a text file. each string is in a new line -- Gaurav Creations
24
by: ThunderMusic | last post by:
Hi, The subject says it all... I want to use a byte and use it as byte* so I can increment the pointer to iterate through it. What is the fastest way of doing so in C#? Thanks ThunderMusic
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.