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?


0
Tomasz
7/17/2003 2:27:07 PM
dotnet.xml 7266 articles. 0 followers. Follow

2 Replies
1277 Views

Similar Articles

[PageSpeed] 38

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:OIFKC#GTDHA.212@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?
>
>


0
7/17/2003 6:44:22 PM
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:OIFKC%23GTDHA.212@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?
>
>


0
Chris
7/20/2003 5:25:31 AM
Reply:

Similar Artilces:

There must be a way.........
There must be a way to be sure all Vista and W7 system files are signed (not corrupted). I've researched and have not found a way. Can anybody help? <five256@NOwhere.com> wrote in message news:hb12r5tjthdtl87hlpgrcapq9b0hd87c4e@4ax.com... > There must be a way to be sure all Vista and W7 system files are signed > (not corrupted). I've researched and have not found a way. Can anybody > help? Yes, there is. It's called the System File Check tool. Read about system file protection here: http://support.microsoft.com/kb/222193 On Mon, 29 Mar 2...

Best text books / manuals for MS Office (intermediate-Advanced use
What are the best (most highly reccomended) text books / instruction manuals you can get for Access, Excel, PowerPoint, Publisher, & Word and also VBE? I consider myself to be Quite proficient in Excel......Can produce a decent document in Publisher.......Can "Get by" in Word....Not enough knowledge of Access......Only used PowerPoint once....... I started using BASIC (the programming language) back in the '80s, so I have some knowledge of VBE (Formulas & syntax are quite simular from what I see now). I have created several Excel projects with Macros bu...

is there a way to hide a whole worksheet in excel?
I would basically like to place all formulae on one worksheet and hide from anyone tempted to amend. most folks know how to unhide cells etc. Even if someone knows a sneakier way of making viewing of formula unviewable Good evening Marion McFarlane To hide a worksheet go to Format > Sheet > Hide. This can be unhidden through the same menu (but use unhide instead). To hide cells from view press ctrl + 1 and change the number format to Custom and ;;; (three semicolons). The formulae will still show in the status bar, so to hide from there, press ctrl + 1 and in the Protection ta...

is there a way to zoom the Excel view to the current highlighted cells..with a single click
Never mind I found it zoom to selection I wonder f theres a way to hotkey (shortcut) this? Jery ...

The best photographer
He is the best famous photographer.. http://club.cyworld.com/dcnomad ...

Where is the best place to put notes?
We are new to MSCRM and are not used to all of the possible places that you can enter notes. Has anyone created a structure for their company as to what notes should be entered where? Wendy, There are many ways to handle notes. You have accurately identified that notes are kind of disjointed. What you might consider doing is creating a central notes depository in Sharepoint and then adding a customization with an inline frame that shows the Sharepoint notes repository in several different parts of CRM. In general, you have not provided enough information on what you are trying to ac...

Formula help in Excel which is the correct way ?
Tax is 23 % which is h-9 Total Cost is 75,000 which is b-9 I want to create a formula in B-11 that is 23% of total cost. So I did =H9*B$11 but apparently this isn't correct so what is the correct formula ?. need an absolute reference to H-7. So if you can give me the correct formula I would appreciate i -- SSVegett ----------------------------------------------------------------------- SSVegetto's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=2822 View this thread: http://www.excelforum.com/showthread.php?threadid=47775 =$H$9*B9 Don't know wher...

what is the best way to resize test that "best fits" the text box
I just want to know how to resize text to fit the text box. Select the text and reduce the font size until it suits your requirements. There is no automatic function for this. -- <>>< ><<> ><<> <>>< ><<> <>>< <>><<> Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org <>>< ><<> ><<> <>>< ><<> <>>< <>><<> "utahjohn" <utahjohn@discussions.microsof...

Best way to forecast individual sales territories?
I have a spreadsheet with twelve months of sales data per territory (100 territories.) I need to forecast the next three months. The product being sold is just moving from launch phase to high growth phase, so it's still growing pretty quickly. What is the best method to forecast each individual territories' sales over the next three months? ...

Is there a "preferred" way to update properties based on other properties?
Let's say I have a class that represents a rectangle: class Rectangle { private int width; private int height; private int area; public int Width { get { return width; } set { width = value; } } public int Height { get { return height; } set { height= value; } } public int Area { get { return area; } } } Obviously, area does not represent anything based on that. How to best keep area in sync is the purpose of this question. One way would be to simply get rid of the variable area, and make the ...

Dropdown menu using xml file
Can anyone please help me. I was looking at the article "http://www.eggheadcafe.com/articles/20030603.asp". I am new to .net and know nothing in c#. I want to write a menu in asp.net. Can anyone please help me in converting this c# code to vb.net. I tried, but it is not giving the output. Here is the c# code using System using System.Collections using System.ComponentModel using System.Data using System.Drawing using System.Web using System.Web.SessionState using System.Web.UI using System.Web.UI.WebControls using System.Web.UI.HtmlControls using System.Xml; using System.Xml.Xsl; us...

OWA/OMA Protection
<No response from other forum> Hello, I have a Exchange 2003/OWA frontend that is protected with RSA two factor authentication inside a Checkpoint Firewall. The RSA part works fine and everything is good. Now I buy a Motorola Droid and need to set up the Exchange Sync and the RSA poses a problem. If I remove the RSA protection the Droid connects to the OWA and syncs well. Calls to RSA says it will not work with a Droid so I'd have to get rid of the RSA authentication. The question is: it looks like if I want to use a Android 2.0 based Droid phone to sync with outlook...

GL figures
what really is the best practice method for brining in monthly GL figures so users can get comparative statements this year/lastyr. do you bring in all the old detail journals? or do you load via a maintenance or IM the historical balance for each month in some file. -- Linda W. Linda, You mean when you are starting up a new company? If so, unless someone needs the detail imported into GP for other reasons, I bring in a beginning balance and monthly net changes only. For example, let's say you're starting to use GP with January 2009, your fiscal year ends in December and y...

Breaking larger xml document into smaller ones
Hi All, I have a problem which I think is sure easy enough that it would have been solved already. I am looking for some pointers here - I have an XML document like this: <root> <child> <element1>value1</element1> <element2>value2</element2> </child> <child> <element1>value1</element1> <element2>value2</element2> </child> .... .... </root> The <child> section like the one above, might repeat for hundreds of thousands of times. Since I am going to process this XML later for som...

best tutorials for graphs ( line of best fit) for excel
What are the best tutorials for using excel for stastical analysis graphs and other graphs such as Line of best fit? Niccole: Here's a link to my chart gallery of Excel statistical charts. http://processtrends.com/TOC_chart_gallery.htm Here's a link to my page on trend analysis with Excel. This page shows several regression techniques that you can use with Excel. http://processtrends.com/toc_trend_analysis_with_Excel.htm Post back if you have more specific questions. Kelly O'Day koday at processtrends dot com "Niccole D" <Niccole D@discussions.microsoft....

Is there an easy way to swap the contents of two cells in Excel?
I think the subject says it all... =?Utf-8?B?Ti5CLiBZb25k?= <N.B. Yond@discussions.microsoft.com> wrote in news:4C32CCD5-DA6F-43A8-9502-B2348D183371@microsoft.com: > I think the subject says it all... > You could add a button to the sheet with following code behind it: Private Sub CommandButton1_Click() cel1 = InputBox("First cell?") cel2 = InputBox("Second cell?") c1 = Range(cel1).Value c2 = Range(cel2).Value Range(cel1).Value = c2 Range(cel2).Value = c1 End Sub You will be asked for the 2 cell addresses and the contents will be ...

division of variable integer into best fit integer parts
Hello I have a variable integer which must be split into 8 integers based on fixed percentages (33%, 18%, 15%, 13%, 11%, 4%, 3%, 3%). These 8 integers must add up to the original number (ie I cannot just multiply integer by % and then use the roundup/rounddown functions as they could add up to more/less than the original number). Is there a function in excel which would work out a best fit solution? Thanks No, there is not a function to do this automatically. Follow the program that you described, but calculate one of the integers by subtraction to make the sum come out right. Jerry ...

Is there an easier way?
There has got to be an easier to accomplish the same end results as the attached formula... any pointers? +-------------------------------------------------------------------+ |Filename: Doc2.doc | |Download: http://www.excelforum.com/attachment.php?postid=4133 | +-------------------------------------------------------------------+ -- wmaughan ------------------------------------------------------------------------ wmaughan's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=29743 View this thread: http://www.ex...

best fit line
I have a line graph with 6 series plotted (I.e. 6 different lines--sales on y, months of x). How do i add a best fit line to the chart? When i select Add Treanline, it only lets you select one series (and I'm assuming the result you get is a linear y=mx+b line....i 'm looking for the best fit line for serveral series... Thanks. jeremy -- Message posted via http://www.officekb.com since it is a line chart, there are several things you could try. If it is justified, you could generate an average of the data points for each x point and plot it. Make a trend line of the average th...

XSLT transform gives invalid XML
Hi, I just tried to run a piece of code working with .Net 1.0 after compiling it with 1.1. It failed and I tracked it down to the XSLT transform method outputting invalid XML. The problem only seems to occur if the XML has an html node. When it does so the transform method seems to take it into its own hands to assume you want non-compliant XML/HTML. An example: using System; using System.IO; using System.Xml; using System.Xml.XPath; using System.Xml.Xsl; namespace XMLTransform { class Class1 { [STAThread] static void Main(string[] args) { XmlDocument modelDom = new XmlDocument(...

Jacob & Co. H-24SSBL Black The Five Time Zone Mens Watch, Best Wristwatch Mall
Jacob & Co. H-24SSBL Black The Five Time Zone Mens Watch, Best Wristwatch Mall Click Here To Website : http://jacob-co.watchesmall.net/Jacob-Co-wristwatch= -3939.html Luxury Watches Mall: http://www.watchesmall.net/ Jacob & Co. H-24SSBL Black The Five Time Zone Mens Watch Information : Brand : Jacob & Co. Watches ( http://jacob-co.watchesmall.net/ ) Gender : Mens Code : jacob-co-watch-h-24ssbl Also Called : Case Material : White Gold Case Thickness : 47.50 mm Dial Color : Black Bezel : White Gold Movement : Automat...

Is there a way to automatically send follow up email messages?
I want to que messages to be sent at a pre-determined time. Is there a way to set up an autoresponder in Outlook? Set the "do not deliver before" option via the Options button when composing a new message. -- Robert Sparnaaij [MVP-Outlook] Coauthor, Configuring Microsoft Outlook 2003 http://www.howto-outlook.com/ Outlook FAQ, HowTo, Downloads, Add-Ins and more http://www.msoutlook.info/ Real World Questions, Real World Answers ----- "Nicky" <Nicky@discussions.microsoft.com> wrote in message news:9AC7385B-678E-4BE8-BD45-448E648F6F32@microsoft...

Validating XML file against an XSD schema
I have an XML file i'd like to validate against an XSD schema. I'm creating the XML on the fly in an ASP.NET page and need to validate it aginst the schema to ensure its well formed. How do i do this? Thanks in advance... Simon Ames Hi simon, Why not searching the msdn? i searched for "xml" "validating" "xsd" and found some pages where to find example code using the XmlValidatingReader e.g. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemXmlXmlValidatingReaderClassctorTopic1.asp http://msdn.microsoft.com/li...

Best Version, best performance
Anyone have a suggestion as to which is the Best Version of MSMoney? I'm using V2003. I'm thinking of upgrading to V05 but wonder if I will gain anything. I've turned off most things in V2003 because of its slow performance therefore I wonder if V2005 is faster? M05 is unlikely to be any faster and brings lots of its own complications. See http://umpmfaq.info/Money2005.htm for one user's opinion. M04 was probably better than M03, but not by very much at all. See also http://umpmfaq.info/faqdb.php?q=174 for some thoughts on what happens if M06 (07, 08, 09...) is no better ...

Best money making programs in the internet!!!
Hi, If you are a stay home person or thinking of making money online, you should look at the following affiliate programs. This person make $3,500 weekly <http://hop.clickbank.net/?reneng/123secrets> This lady make $435K last year with this Super affiliate program <http://hop.clickbank.net/?reneng/webvista2> Earn $500,000.00 with $5 www.magictools.nl/list/1063/ <http://www.magictools.nl/list/1063/> Buy cheap cars from $200 and earn money <http://refer.ccbill.com/cgi-bin/clicks.cgi?A=928797-0000&PA=reneng> All the best! Rene --- MAF Anti-Spam I...