473,804 Members | 2,296 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.2277771 09151971</v>
<v y="1998" m="1" h="2">0.2065739 03224972</v>
<v y="1998" m="1" h="3">0.1651402 19440699</v>
<v y="1998" m="1" h="4">0.1242934 31158821</v>
<v y="1998" m="1" h="5">0.1040027 98378086</v>
<v y="1998" m="1" h="6">0.0812389 501473294</v>
<v y="1998" m="1" h="7">0.0136806 566150509</v>
<v y="1998" m="1" h="8">0.0607339 108863059</v>
<v y="1998" m="1" h="9">0.1113946 21283997</v>
<v y="1998" m="1" h="10">0.168801 709563907</v>
<v y="1998" m="1" h="11">0.086560 7844888258</v>
<v y="1998" m="1" h="12">0.101389 182210782</v>
<v y="1998" m="1" h="13">0.204044 532248796</v>
<v y="1998" m="1" h="14">0.157314 882488258</v>
<v y="1998" m="1" h="15">0.121055 145349667</v>
<v y="1998" m="1" h="16">0.102359 195578094</v>
<v y="1998" m="1" h="17">0.019998 5034684297</v>
<v y="1998" m="1" h="18">0.107776 377100517</v>
<v y="1998" m="1" h="19">0.140707 273209167</v>
<v y="1998" m="1" h="20">0.116934 362505389</v>
<v y="1998" m="1" h="21">0.181578 399407852</v>
<v y="1998" m="1" h="22">0.162783 178544661</v>
<v y="1998" m="1" h="23">0.248914 944436437</v>
<v y="1998" m="1" h="24">0.201314 812545552</v>
<v y="1998" m="2" h="1">0.1694681 99288149</v>
....
<v y="2050" m="12" h="24">-0.9304912785006 16</v>
</data>

Thanks for your help

jahrens
Mar 8 '07 #1
4 5644
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.m icrosoft.comwro te in message
news:iI******** ******@TK2MSFTN GHUB02.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
3040
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 search each time the user types a new letter in the text box. That's badly explained - this example might help! The user types "r" and I displays all the names with r in them. The
0
1510
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 function for "read-only" situtations. it doesn't appear to be useful in situations where editing must be done on the loaded file. the next fastest method (based on my searches) seemed to be a fread(3)/read(2) loop. however, malloc(3)'s seems to slow
11
2119
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 like to be able to retrieve the name by searching for a given phone number the fastest I can. I have considered the posibility of using XmlTextReader with something like: <list> <item number="1234567"> <name>John Doe</name>
60
49223
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 be indexed/sorted. I don't want to load the entire file into physical memory, memory-mapped files are ok (and preferred). Speed/performance is a requirement -- the target is to locate the string in 10 seconds or less for a 100 MB file. The...
11
3627
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 million lines. b) I need to store the contents into a unique hash. c) I need to then sort the data on a specific field. d) I need to pull out certain fields and report them to the user.
5
4504
by: Tales Normando | last post by:
The title says it all. Anyone?
5
2843
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
2296
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
0
9594
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10347
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9173
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7635
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5531
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5673
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4308
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3832
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3001
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.