473,382 Members | 1,791 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,382 software developers and data experts.

best way to deserialize xml

I'm at a quandry as to what's the best/fastest way to deserialize an
incoming xml stream?

I ran a small test on xmlserializer and on a small file it performed 10
times worse then when I used the XMLDocument and deserialized the values
myself. Is the xmlserializer really that slow?

I'm expecting a file about 1 MB in length and if it's that slow on a 2 K
file then I can't phantom how it's going to behave on a 1 MB file.

Should I just skip the xmlserializer and XML Dom and go straight to
xmlreader and do the deserialization myself?
Nov 11 '05 #1
2 5310
This has been discussed a few times. The bmost expensive operation is the
initial instantiation of an XmlSerializer for a certain type, make sure you
design around that. Check the archives [0] for more on that topic.
--
HTH
Christoph Schittko [MVP]
Software Architect, .NET Mentor

[0] http://groups.google.com

"Tomasz Kaszuba" <tomasz.kaszuba@N!O!inteligoS!P!A!M.pl> wrote in message
news:OI*************@TK2MSFTNGP10.phx.gbl...
I'm at a quandry as to what's the best/fastest way to deserialize an
incoming xml stream?

I ran a small test on xmlserializer and on a small file it performed 10
times worse then when I used the XMLDocument and deserialized the values
myself. Is the xmlserializer really that slow?

I'm expecting a file about 1 MB in length and if it's that slow on a 2 K
file then I can't phantom how it's going to behave on a 1 MB file.

Should I just skip the xmlserializer and XML Dom and go straight to
xmlreader and do the deserialization myself?

Nov 11 '05 #2
The serializer is only slow the first time you call it. The reason for
this is that it actually generates code to do the serialization, then
compiles that code. Then the compiled code flies.

"Tomasz Kaszuba" <tomasz.kaszuba@N!O!inteligoS!P!A!M.pl> wrote in message
news:OI***************@TK2MSFTNGP10.phx.gbl...
I'm at a quandry as to what's the best/fastest way to deserialize an
incoming xml stream?

I ran a small test on xmlserializer and on a small file it performed 10
times worse then when I used the XMLDocument and deserialized the values
myself. Is the xmlserializer really that slow?

I'm expecting a file about 1 MB in length and if it's that slow on a 2 K
file then I can't phantom how it's going to behave on a 1 MB file.

Should I just skip the xmlserializer and XML Dom and go straight to
xmlreader and do the deserialization myself?

Nov 11 '05 #3

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

Similar topics

7
by: Ian Tompsett | last post by:
H I was wondering if it possible for an object to serialize/deserialize itself from XML. I'd be guessing that it would need to use the XmlSerializer class, but that seems to want to create a...
0
by: Richard | last post by:
I am trying to take an XML snipit like the following: <project> <stuff1/> <stuff2/> </project> <project> <stuff1/> <stuff2/> </project>
1
by: Bsiang Tan | last post by:
I try to serialize my object into xml it work, but I can't deserialize it back. I get an exception.. :- An unhandled exception of type 'System.Reflection.TargetInvocationException' occurred...
7
by: MrNobody | last post by:
I was a Java developer so I'm used to using property files as a means to keep configuration settings for my apps. I'm wondering what options are there with ..NET? Some settings I want to include...
2
by: Henrik Skak Pedersen | last post by:
Hello, I have a class which is beeing serialized/deserialized using the BinaryFormatter class. That has been working with no problems until I signed all my assemblies. Now I get a...
19
by: Sharon | last post by:
Hi, When I'm doing BinaryFormatter.Deserialize() over a TCP socket. When I'm closing the TcpListener by invoking the TcpListener.Stop(); I get: System.IO.IOException with message "Unable to...
1
by: =?Utf-8?B?SmVyZW15X0I=?= | last post by:
I am working on an order entry program and have a question related to deserializing nodes with nested elements. The purchase order contains multiple line items which I select using an...
4
by: ink | last post by:
Hi all, I am trying to pull some financial data off of an HTML web page so that I can store it in a Database for Sorting and filtering. I have been thinking about this for some time and trying...
0
by: Smokey Grindel | last post by:
I serialized an object perfectly fine to SOAP and have it stored in a database as a string (sql server 2005 in a XML data type field) now I am pulling that value back and want to de-serialize it...
4
by: Brian | last post by:
HI, I have two sets of data, the largest set of data contains 370 rows... both sets only have two columns. I want to be able to distribute the data with my applaction. The other option, would be...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.