Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ReadXML Speed

0 views
Skip to first unread message

Karl-Inge Reknes

unread,
Jun 17, 2005, 9:54:02 AM6/17/05
to
hi,
I use at WebServices to get data to the PPC from the database server (via
Wlan). I use the following code:

Dataset1 = Ws.GetData1();

This take about 45 second. Too speed this up I tried to save the dataset to
XML file and read the file instead of using the webservices. I use this code:

Write dataset:
dataset1.WriteXml("data.xml")

Read dataset:
dataset1.ReadXml("data.xml");

To write the dataset to xml file goes fast, but to read the xml file takes
about 50 second.

Do anybody have an solution that give an better performance.

Regards
Karl-Inge Reknes

Alex Feinman [MVP]

unread,
Jun 17, 2005, 10:50:57 AM6/17/05
to
To improve ReadXml speed you need to use schema. Save schema of your dataset
once using WriteXmlSchema. Then, before calling ReadXml, call ReadXmlSchema
to load schema. This will ensure much faster XML load. I prefer to store
schemas in assembly resource

--
Alex Feinman
---
Visit http://www.opennetcf.org
"Karl-Inge Reknes" <KarlIng...@discussions.microsoft.com> wrote in
message news:98198962-56B2-49F2...@microsoft.com...

Karl-Inge Reknes

unread,
Jun 20, 2005, 8:09:09 AM6/20/05
to
Tanks!

I have tried this code:

DataSet1.WriteXmlSchema("\\Program Files\\norbitPPC\\grunndata.xsd");
DataSet1.WriteXml("\\Program Files\\norbitPPC\\grunndata.xml");

DataSet dsTemp = new DataSet();
dsTemp.ReadXmlSchema("\\Program Files\\norbitPPC\\grunndata.xsd");
dsTemp.ReadXml("\\Program Files\\norbitPPC\\grunndata.xml");

DateSet1 = dsTemp;

To read the XML takes now about 17 sec. Is this the most efficient way?

Karl-Inge Reknes

Alex Feinman [MVP]

unread,
Jun 20, 2005, 9:58:29 AM6/20/05
to
I'm curious, how big is the xml?

--
Alex Feinman
---
Visit http://www.opennetcf.org
"Karl-Inge Reknes" <KarlIng...@discussions.microsoft.com> wrote in

message news:5C668C48-23A0-4A7E...@microsoft.com...

Karl-Inge Reknes

unread,
Jun 20, 2005, 10:05:03 AM6/20/05
to
The XML file is 330 byte and the XSD file i 1,18 kB. I use Symbol PPC MC9060
with 64MB ram.

Ilya Tumanov [MS]

unread,
Jun 20, 2005, 2:26:40 PM6/20/05
to
That can't be right. Such a small file will be loaded in under a second with
or without schema.

The very fact you see the performance improvements with schema suggests your
file is way bigger than 330 bytes.

Our tests indicate ~1 MB of data (1200 records of 33 fields of various types
in 3 nested tables) would be loaded in about 22 second with schema and in
about 75 seconds without it on PXA 255-400 MHz device running PPC 03 and CF
V1 SP3.

If you're measuring first pass, it would be few seconds longer as
Data/Schema code would be JITed.


Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.

*** Want to find answers instantly? Here's how... ***

1. Go to
http://groups-beta.google.com/group/microsoft.public.dotnet.framework.compactframework?hl=en
2. Type your question in the text box near "Search this group" button.
3. Hit "Search this group" button.
4. Read answer(s).

"Karl-Inge Reknes" <KarlIng...@discussions.microsoft.com> wrote in

message news:84786D0F-8F03-4759...@microsoft.com...

Sachin Palewar

unread,
Jun 21, 2005, 3:57:07 AM6/21/05
to
That was a nice benchmark info Ilya. But I am just curious about using
a CSV text file instead of XML file. Do you have some performance
benchmark info if I decide to use CSV instead of XML file with same
data. I am interested in CSV because I feel a CSV containing same data
will be much small than an XML file.

Looking forward to your reply...

Sachin

in...@it-design.biz

unread,
Jun 21, 2005, 5:30:44 AM6/21/05
to
How fast would be the CSV in comparison to the XML File ?

Ilya Tumanov [MS]

unread,
Jun 21, 2005, 2:14:21 PM6/21/05
to
CSV will be faster than XML as it's very easy to parse and it does not carry
extra tag information.

How much faster? That depends on XML.

If you have many nested tables and columns are mapped as elements - may be a
lot faster.

If you're using related tables and all columns are mapped as attributes -
may be somewhat faster.

Since NETCF does not offer CSV support, we do not have performance data on
it.

You could try using OpenNETCF CSV adapter and see if performance is OK.

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.

*** Want to find answers instantly? Here's how... ***

1. Go to
http://groups-beta.google.com/group/microsoft.public.dotnet.framework.compactframework?hl=en
2. Type your question in the text box near "Search this group" button.
3. Hit "Search this group" button.
4. Read answer(s).

"Sachin Palewar" <pal...@gmail.com> wrote in message
news:1119340627.2...@g44g2000cwa.googlegroups.com...

Ginny Caughey [MVP]

unread,
Jun 22, 2005, 7:16:50 AM6/22/05
to
As Ilya says, it despends on the XML. With the Northwind customers and
orders tables, it is about twice as fast using beta 2 of .NetCFv2. I haven't
done any benchmarking with version 1, but since XML parsing is faster in
version 2, I'd guess the speed improvement would be even greater with
.NetCFv1.

Ginny Caughey
.NET Compact Framework MVP

<in...@it-design.biz> wrote in message
news:1119346244.7...@o13g2000cwo.googlegroups.com...

Sachin Palewar

unread,
Jun 23, 2005, 3:41:52 AM6/23/05
to
Thanks IIya and Ginny for your responses. They have been helpful. I
would like to draw your attention to another thread i posted regarding
Managed Library for Activesync, I haven't yet received any reply on it.
I was just wondering if you guys could throw some light on the topice.
Thanks again.

You can reach to thread at:
http://groups-beta.google.com/group/microsoft.public.dotnet.framework.compactframework/browse_thread/thread/b8ace193fd4bae1c/20665fd465c36cda#20665fd465c36cda

Ginny Caughey [MVP]

unread,
Jun 23, 2005, 6:55:53 AM6/23/05
to
Sachin,

Writing an ActiveSync plugin still requries C++.

Ginny

"Sachin Palewar" <pal...@gmail.com> wrote in message

news:1119512512....@z14g2000cwz.googlegroups.com...

Sachin Palewar

unread,
Jun 27, 2005, 4:53:50 AM6/27/05
to
Thanks for response Ginny. You mean to say I can not develop any of
these 2 in vb.net?

1. Activesync Provider
2. Activesync File Filter

<ctacke/>

unread,
Jun 27, 2005, 6:36:55 AM6/27/05
to
Correct. Neither can be written in VB.NET

-Chris


"Sachin Palewar" <pal...@gmail.com> wrote in message

news:1119862430.6...@g44g2000cwa.googlegroups.com...

0 new messages