Using Comma Separated Values to de-serialize a DataSet

G

Guest

Subject: Using Comma Separated Values to de-serialize a DataSet

The DataSet.ReadXml() speed under Netcf1.0 is slow. It results in our App
taking over 60 seconds to start. I have talked to many newsgroups, researched
articles, etc to find a way to improve this time. The best answer to date is
to upgrade to Netcf2.0. I am in the process of doing this but there may be
problems with updating the physical device.

One other possibility was mentioned on a newsgroup. That is to use Comma
Separated Values rather then Xml to load the DataSet. Does anyone know how
that would be done and if any code snippets or examples exist.

Thanks.
 
P

Philip Sheard

You might want to consider using TSV format instead. It is easier to parse,
and you can give the files a txt extension, which sometimes helps.
 
G

Ginny Caughey [MVP]

John,

Look at the TextDataAdapter on www.opennetcf.org. Depending on the device
and the particular data, CSV can be twice as fast and half as bulky as XML.
But on Windows Mobile 5.0 devices running CF 2.0 that I've tested, the
performance gap between XML and CSV isn't so dramatic (or even apparent in
some cases.)
 
G

Guest

Sorry, TSV stands for?

Also any code snippets or samples on de-serializing a DataSet from a TSV.

Thanks.

--
John Olbert



Philip Sheard said:
You might want to consider using TSV format instead. It is easier to parse,
and you can give the files a txt extension, which sometimes helps.
 
P

Paul G. Tobey [eMVP]

I'm not 100% sure, but I'm guessing Tab-separated Values.

Paul T.

John Olbert said:
Sorry, TSV stands for?

Also any code snippets or samples on de-serializing a DataSet from a TSV.

Thanks.
 
P

Philip Sheard

There is an official standard for TSV format, but none for CSV. CSV just
happens to be more prevalent.

Paul G. Tobey said:
I'm not 100% sure, but I'm guessing Tab-separated Values.

Paul T.
 
G

Guest

That is a shame. We are seeing load times of 8 to 12 seconds on a Xml file of
24kb being read into a DataSet via ReadXml. I was trying to find a way to get
that down to about 1 to 2 seconds. We do a number of reads and the end result
is that the app takes over 60 seconds to load up.

Thanks.

--
John Olbert



Ginny Caughey said:
John,

Look at the TextDataAdapter on www.opennetcf.org. Depending on the device
and the particular data, CSV can be twice as fast and half as bulky as XML.
But on Windows Mobile 5.0 devices running CF 2.0 that I've tested, the
performance gap between XML and CSV isn't so dramatic (or even apparent in
some cases.)
 
G

Ginny Caughey [MVP]

John,

I doubt you'll get it down to 1 or 2 seconds, but depending on the data and
the device, you might get it down to 4-6 seconds with the
OpenNETCF.TextDataAdapter and a csv file. ReadXml is generally faster with
CF 2 also - maybe twice as fast in my testing but your mileage may vary.

If you can't get the load time down much, be sure to have a nice splash
screen for the users to look at. ;-)

--
Ginny Caughey
..NET Compact Framework MVP


John Olbert said:
That is a shame. We are seeing load times of 8 to 12 seconds on a Xml file
of
24kb being read into a DataSet via ReadXml. I was trying to find a way to
get
that down to about 1 to 2 seconds. We do a number of reads and the end
result
is that the app takes over 60 seconds to load up.

Thanks.
 
P

Philip Sheard

Our TSV import rogers through about 330 KB in 39 seconds, *and* inserts
about 3,000 rows into SQL tables. That is on a fairly humble Acer n30. No
C++, or tricks with fruit. Just bog standard VB.

With TSV, I can parse a file thus:

Dim f() As String
Dim a() As String
Dim s As String

With New StreamReader("\My Documents\data.txt")
s = .ReadToEnd
.Close
End With

s = Replace(s, vbCrLf, ChrW(1))
s = Replace(s, vbLf, vbCrLf)
f = Split(s, ChrW(1))

for each s in f
a = Split(s, vbTab)
next

You are talking speed here. And I can edit the file in Pocket Word if I want
to. Try doing that with XML. Or CSV for that matter.

John Olbert said:
That is a shame. We are seeing load times of 8 to 12 seconds on a Xml file
of
24kb being read into a DataSet via ReadXml. I was trying to find a way to
get
that down to about 1 to 2 seconds. We do a number of reads and the end
result
is that the app takes over 60 seconds to load up.

Thanks.
 
I

Ilya Tumanov [MS]

XML loading time depends on what are you loading and how you do that.



Please see this on how to speed it up:



http://groups.google.com/group/micr...amework.compactframework/msg/6f6a9cbdff962bad



Also note first load includes JITing time which is about 3-5 seconds.


--
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).

John Olbert said:
That is a shame. We are seeing load times of 8 to 12 seconds on a Xml file
of
24kb being read into a DataSet via ReadXml. I was trying to find a way to
get
that down to about 1 to 2 seconds. We do a number of reads and the end
result
is that the app takes over 60 seconds to load up.

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top