PC Review


Reply
Thread Tools Rate Thread

CF SP2 and ReadXML performance

 
 
Richard Kucia
Guest
Posts: n/a
 
      2nd Mar 2004
My app's startup time has always been horrible, so I was looking forward
with great anticipation to CF SP2.
The app reads a single XML file once during its startup, and it stores the
contents in various objects.

I installed CF SP2 (non-developer) on my Dell Axim X5 and timed ReadXML in a
variety of ways. I created a two files, one with and one without an embedded
schema. Then I tried various combinations of ReadXML and XMLReadMode. Here
are the results, in milliseconds:

File and XMLReadMode Elapsed Time in ms
-------------------------- -------------------
NoSchema + Auto 14.129
Schema + Auto 6.782
Schema + Ignore .358
Schema + ReadSchema 5.630
NoSchema + Auto 12.711
NoSchema + Infer 12.146

Typical code for any one of these cases is:
RaiseEvent InitializationStepEvent("User: Reference file: No Schema + Auto")

ReferenceDataSet = New System.Data.DataSet("reference")

fsXML = New System.IO.FileStream(clsCommon.AppPath & "Reference With No
Schema.xml", System.IO.FileMode.Open, IO.FileAccess.Read)

myXmlReader = New System.Xml.XmlTextReader(fsXML) ' Create an XmlTextReader
to read the file

ReferenceDataSet.ReadXml(myXmlReader, System.Data.XmlReadMode.InferSchema)


I believe the Axim is running CF CLR 1.0.3316.0

Can anyone offer an explanation for the truly wide disparity among these
results? I'd be happy to send the files to anyone wishing to reproduce these
test results.

Richard Kucia


 
Reply With Quote
 
 
 
 
Richard Kucia
Guest
Posts: n/a
 
      2nd Mar 2004
Of course, those times are in seconds, not milliseconds...

"Richard Kucia" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> My app's startup time has always been horrible, so I was looking forward
> with great anticipation to CF SP2.
> The app reads a single XML file once during its startup, and it stores the
> contents in various objects.
>
> I installed CF SP2 (non-developer) on my Dell Axim X5 and timed ReadXML in

a
> variety of ways. I created a two files, one with and one without an

embedded
> schema. Then I tried various combinations of ReadXML and XMLReadMode. Here
> are the results, in milliseconds:
>
> File and XMLReadMode Elapsed Time in ms
> -------------------------- -------------------
> NoSchema + Auto 14.129
> Schema + Auto 6.782
> Schema + Ignore .358
> Schema + ReadSchema 5.630
> NoSchema + Auto 12.711
> NoSchema + Infer 12.146
>
> Typical code for any one of these cases is:
> RaiseEvent InitializationStepEvent("User: Reference file: No Schema +

Auto")
>
> ReferenceDataSet = New System.Data.DataSet("reference")
>
> fsXML = New System.IO.FileStream(clsCommon.AppPath & "Reference With No
> Schema.xml", System.IO.FileMode.Open, IO.FileAccess.Read)
>
> myXmlReader = New System.Xml.XmlTextReader(fsXML) ' Create an

XmlTextReader
> to read the file
>
> ReferenceDataSet.ReadXml(myXmlReader, System.Data.XmlReadMode.InferSchema)
>
>
> I believe the Axim is running CF CLR 1.0.3316.0
>
> Can anyone offer an explanation for the truly wide disparity among these
> results? I'd be happy to send the files to anyone wishing to reproduce

these
> test results.
>
> Richard Kucia
>
>



 
Reply With Quote
 
Ilya Tumanov [MS]
Guest
Posts: n/a
 
      3rd Mar 2004
Richard,

Please see inline...

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
> From: "Richard Kucia" <(E-Mail Removed)>
> Subject: CF SP2 and ReadXML performance
> Date: Tue, 2 Mar 2004 17:18:05 -0500
> Lines: 42
> X-Priority: 3
> X-MSMail-Priority: Normal
> X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
> Message-ID: <(E-Mail Removed)>
> Newsgroups: microsoft.public.dotnet.framework.compactframework
> NNTP-Posting-Host: 146.cleveland-11-13rs.oh.dial-access.att.net

12.75.70.146
> Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
> Xref: cpmsftngxa06.phx.gbl

microsoft.public.dotnet.framework.compactframework:47475
> X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework
>
> My app's startup time has always been horrible, so I was looking forward
> with great anticipation to CF SP2.
> The app reads a single XML file once during its startup, and it stores the
> contents in various objects.
>
> I installed CF SP2 (non-developer) on my Dell Axim X5 and timed ReadXML

in a
> variety of ways. I created a two files, one with and one without an

embedded
> schema. Then I tried various combinations of ReadXML and XMLReadMode. Here
> are the results, in milliseconds:
>
> File and XMLReadMode Elapsed Time in ms
> -------------------------- -------------------
> NoSchema + Auto 14.129


Schema inferred, this is the slowest way to go and it should be generally
avoided.
However, in case of very small XML it could be faster than loading schema.

> Schema + Auto 6.782


Schema is loaded first; data is loaded based on schema.
This is second best to use. Best one is to have schema already in the
DataSet.
Schema code is a big and complicated one; it takes few seconds to JIT and
execute it.

> Schema + Ignore .358


This is fast as it's doing nothing.
Since you do not have schema in the DataSet and you choose to ignore schema
in XML, no data is actually loaded.

> Schema + ReadSchema 5.630


Same as Schema + Auto. If you running tests in a batch, it might appear a
bit faster as code is preJITed already.

> NoSchema + Auto 12.711


Schema inferred. Again, might appear faster because code has been preJITed.

> NoSchema + Infer 12.146


Same as above, done in about the same time.

>
> Typical code for any one of these cases is:
> RaiseEvent InitializationStepEvent("User: Reference file: No Schema +

Auto")
>
> ReferenceDataSet = New System.Data.DataSet("reference")
>
> fsXML = New System.IO.FileStream(clsCommon.AppPath & "Reference With No
> Schema.xml", System.IO.FileMode.Open, IO.FileAccess.Read)
>
> myXmlReader = New System.Xml.XmlTextReader(fsXML) ' Create an

XmlTextReader
> to read the file
>
> ReferenceDataSet.ReadXml(myXmlReader, System.Data.XmlReadMode.InferSchema)
>
>
> I believe the Axim is running CF CLR 1.0.3316.0
>
> Can anyone offer an explanation for the truly wide disparity among these
> results? I'd be happy to send the files to anyone wishing to reproduce

these
> test results.


There's no disparity, it's in fact very consistent.
It takes 12-14 seconds to infer schema, 5-7 seconds to load schema and
data, .4 seconds to scan the file and do nothing.
If you preJIT the code, time will probably match to a fractions of a second.

>
> Richard Kucia
>
>
>


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ReadXml Tony Johansson Microsoft C# .NET 0 25th Aug 2008 08:25 AM
DataTable.ReadXml performance problem Sagaert Johan Microsoft Dot NET Compact Framework 1 10th Jan 2008 12:01 PM
Help with ReadXML Ryan Ramsey Microsoft C# .NET 1 17th Jun 2006 01:55 AM
dataset.readxml performance problem Service Pack 3 beta obiwan1130 Microsoft Dot NET Compact Framework 1 22nd Jul 2004 07:18 PM
dataset.readxml performance problem Service Pack 3 beta obiwan1130 Microsoft Dot NET Framework 0 21st Jul 2004 11:05 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:28 PM.