PC Review


Reply
Thread Tools Rating: Thread Rating: 1 votes, 1.00 average.

DataSet.ReadXml is very slow

 
 
hs
Guest
Posts: n/a
 
      23rd Jul 2003
Hi
I'm doing the following code

DataSet ds = new DataSet();
ds.ReadXml("product.xml"); //product.xml is 3Mb
//or ds.ReadXml(new FileStream("product.xml", File.Open));
//or ds.ReadXml(new XmlTextReader(new StringReader("<root>very long
xml</root>")));
dataGrid1.DataSource = ds.Tables[0];

the ReadXml method is taking a long time to complete (12 seconds approx, in
debug).
It doesnt matter if I use a XmlTextReader, or a Stream in the ReadXml
constructor, it still takes about 12 seconds. Can someone tell me how I
could improve this speed.


thanks





 
Reply With Quote
 
 
 
 
Scot Rose [MSFT]
Guest
Posts: n/a
 
      24th Jul 2003
You have given no information about the size of the XML (How many rows are we talking about?) For a small file , 12 seconds may be a long time, for a large file it might be really
good... WIthout that information as a frame of reference it is hard to determine either way.

Want to know more? Check out the MSDN Library at http://msdn.microsoft.com or the Microsoft Knowledge Base at http://support.microsoft.com

Scot Rose, MCSD
Microsoft Visual Basic Developer Support
Email : (E-Mail Removed) <Remove word online. from address>

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




--------------------
>Reply-To: "hs" <(E-Mail Removed)>
>From: "hs" <(E-Mail Removed)>
>Subject: DataSet.ReadXml is very slow
>Date: Wed, 23 Jul 2003 15:31:32 +0100
>Lines: 23
>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.adonet
>NNTP-Posting-Host: mailgate.synergy-logistics.co.uk 62.49.130.162
>Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
>Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.adonet:56527
>X-Tomcat-NG: microsoft.public.dotnet.framework.adonet
>
>Hi
>I'm doing the following code
>
>DataSet ds = new DataSet();
>ds.ReadXml("product.xml"); //product.xml is 3Mb
>//or ds.ReadXml(new FileStream("product.xml", File.Open));
>//or ds.ReadXml(new XmlTextReader(new StringReader("<root>very long
>xml</root>")));
>dataGrid1.DataSource = ds.Tables[0];
>
>the ReadXml method is taking a long time to complete (12 seconds approx, in
>debug).
>It doesnt matter if I use a XmlTextReader, or a Stream in the ReadXml
>constructor, it still takes about 12 seconds. Can someone tell me how I
>could improve this speed.
>
>
>thanks
>
>
>
>
>
>



 
Reply With Quote
 
hs
Guest
Posts: n/a
 
      24th Jul 2003
Hi Scot
product.xml, a file i created using DataSet.WriteXml(), is about 3Mb (i
mentioned this in my first post) and is 3000 records approximately (which i
didn't mention).
I've looked at alot of links on msdn but can't find anything about my issue.

thanks



"Scot Rose [MSFT]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> You have given no information about the size of the XML (How many rows are

we talking about?) For a small file , 12 seconds may be a long time, for a
large file it might be really
> good... WIthout that information as a frame of reference it is hard to

determine either way.
>
> Want to know more? Check out the MSDN Library at http://msdn.microsoft.com

or the Microsoft Knowledge Base at http://support.microsoft.com
>
> Scot Rose, MCSD
> Microsoft Visual Basic Developer Support
> Email : (E-Mail Removed) <Remove word online. from address>
>
> This posting is provided "AS IS", with no warranties, and confers no

rights.
>
>
>
>
> --------------------
> >Reply-To: "hs" <(E-Mail Removed)>
> >From: "hs" <(E-Mail Removed)>
> >Subject: DataSet.ReadXml is very slow
> >Date: Wed, 23 Jul 2003 15:31:32 +0100
> >Lines: 23
> >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.adonet
> >NNTP-Posting-Host: mailgate.synergy-logistics.co.uk 62.49.130.162
> >Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
> >Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.adonet:56527
> >X-Tomcat-NG: microsoft.public.dotnet.framework.adonet
> >
> >Hi
> >I'm doing the following code
> >
> >DataSet ds = new DataSet();
> >ds.ReadXml("product.xml"); //product.xml is 3Mb
> >//or ds.ReadXml(new FileStream("product.xml", File.Open));
> >//or ds.ReadXml(new XmlTextReader(new StringReader("<root>very long
> >xml</root>")));
> >dataGrid1.DataSource = ds.Tables[0];
> >
> >the ReadXml method is taking a long time to complete (12 seconds approx,

in
> >debug).
> >It doesnt matter if I use a XmlTextReader, or a Stream in the ReadXml
> >constructor, it still takes about 12 seconds. Can someone tell me how I
> >could improve this speed.
> >
> >
> >thanks
> >
> >
> >
> >
> >
> >

>
>



 
Reply With Quote
 
Scot Rose [MSFT]
Guest
Posts: n/a
 
      25th Jul 2003
I missed that<G> 3mb is a pretty large file for only 3000 records. Are some of the fields Long text fields or Binary fields? How long does it take to write out the XMLin the fist place?

Want to know more? Check out the MSDN Library at http://msdn.microsoft.com or the Microsoft Knowledge Base at http://support.microsoft.com

Scot Rose, MCSD
Microsoft Visual Basic Developer Support
Email : (E-Mail Removed) <Remove word online. from address>

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




--------------------
>Reply-To: "hs" <(E-Mail Removed)>
>From: "hs" <(E-Mail Removed)>
>References: <(E-Mail Removed)> <(E-Mail Removed)>
>Subject: Re: DataSet.ReadXml is very slow
>Date: Thu, 24 Jul 2003 15:27:05 +0100
>Lines: 77
>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: <u4Vgp#(E-Mail Removed)>
>Newsgroups: microsoft.public.dotnet.framework.adonet
>NNTP-Posting-Host: mailgate.synergy-logistics.co.uk 62.49.130.162
>Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11.phx.gbl
>Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.adonet:56632
>X-Tomcat-NG: microsoft.public.dotnet.framework.adonet
>
>Hi Scot
>product.xml, a file i created using DataSet.WriteXml(), is about 3Mb (i
>mentioned this in my first post) and is 3000 records approximately (which i
>didn't mention).
>I've looked at alot of links on msdn but can't find anything about my issue.
>
>thanks
>
>
>
>"Scot Rose [MSFT]" <(E-Mail Removed)> wrote in message
>news:(E-Mail Removed)...
>> You have given no information about the size of the XML (How many rows are

>we talking about?) For a small file , 12 seconds may be a long time, for a
>large file it might be really
>> good... WIthout that information as a frame of reference it is hard to

>determine either way.
>>
>> Want to know more? Check out the MSDN Library at http://msdn.microsoft.com

>or the Microsoft Knowledge Base at http://support.microsoft.com
>>
>> Scot Rose, MCSD
>> Microsoft Visual Basic Developer Support
>> Email : (E-Mail Removed) <Remove word online. from address>
>>
>> This posting is provided "AS IS", with no warranties, and confers no

>rights.
>>
>>
>>
>>
>> --------------------
>> >Reply-To: "hs" <(E-Mail Removed)>
>> >From: "hs" <(E-Mail Removed)>
>> >Subject: DataSet.ReadXml is very slow
>> >Date: Wed, 23 Jul 2003 15:31:32 +0100
>> >Lines: 23
>> >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.adonet
>> >NNTP-Posting-Host: mailgate.synergy-logistics.co.uk 62.49.130.162
>> >Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
>> >Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.adonet:56527
>> >X-Tomcat-NG: microsoft.public.dotnet.framework.adonet
>> >
>> >Hi
>> >I'm doing the following code
>> >
>> >DataSet ds = new DataSet();
>> >ds.ReadXml("product.xml"); //product.xml is 3Mb
>> >//or ds.ReadXml(new FileStream("product.xml", File.Open));
>> >//or ds.ReadXml(new XmlTextReader(new StringReader("<root>very long
>> >xml</root>")));
>> >dataGrid1.DataSource = ds.Tables[0];
>> >
>> >the ReadXml method is taking a long time to complete (12 seconds approx,

>in
>> >debug).
>> >It doesnt matter if I use a XmlTextReader, or a Stream in the ReadXml
>> >constructor, it still takes about 12 seconds. Can someone tell me how I
>> >could improve this speed.
>> >
>> >
>> >thanks
>> >
>> >
>> >
>> >
>> >
>> >

>>
>>

>
>
>



 
Reply With Quote
 
hs
Guest
Posts: n/a
 
      28th Jul 2003
Hi Scott,
It doesn't take that long to write out the xml (about 1-2 seconds). Most of
the fields are strings, some are datetimes but no binary or longs. There are
some ints as well.
The table the dataset is reading (ds.ReadXml) has about 30 fields per
datarow. An end user probably wouldn't request this much information but i
am trying out the worst case scenario.


thanks



"Scot Rose [MSFT]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I missed that<G> 3mb is a pretty large file for only 3000 records. Are

some of the fields Long text fields or Binary fields? How long does it take
to write out the XMLin the fist place?
>
> Want to know more? Check out the MSDN Library at http://msdn.microsoft.com

or the Microsoft Knowledge Base at http://support.microsoft.com
>
> Scot Rose, MCSD
> Microsoft Visual Basic Developer Support
> Email : (E-Mail Removed) <Remove word online. from address>
>
> This posting is provided "AS IS", with no warranties, and confers no

rights.
>
>
>
>
> --------------------
> >Reply-To: "hs" <(E-Mail Removed)>
> >From: "hs" <(E-Mail Removed)>
> >References: <(E-Mail Removed)>

<(E-Mail Removed)>
> >Subject: Re: DataSet.ReadXml is very slow
> >Date: Thu, 24 Jul 2003 15:27:05 +0100
> >Lines: 77
> >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: <u4Vgp#(E-Mail Removed)>
> >Newsgroups: microsoft.public.dotnet.framework.adonet
> >NNTP-Posting-Host: mailgate.synergy-logistics.co.uk 62.49.130.162
> >Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11.phx.gbl
> >Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.adonet:56632
> >X-Tomcat-NG: microsoft.public.dotnet.framework.adonet
> >
> >Hi Scot
> >product.xml, a file i created using DataSet.WriteXml(), is about 3Mb (i
> >mentioned this in my first post) and is 3000 records approximately (which

i
> >didn't mention).
> >I've looked at alot of links on msdn but can't find anything about my

issue.
> >
> >thanks
> >
> >
> >
> >"Scot Rose [MSFT]" <(E-Mail Removed)> wrote in message
> >news:(E-Mail Removed)...
> >> You have given no information about the size of the XML (How many rows

are
> >we talking about?) For a small file , 12 seconds may be a long time, for

a
> >large file it might be really
> >> good... WIthout that information as a frame of reference it is hard to

> >determine either way.
> >>
> >> Want to know more? Check out the MSDN Library at

http://msdn.microsoft.com
> >or the Microsoft Knowledge Base at http://support.microsoft.com
> >>
> >> Scot Rose, MCSD
> >> Microsoft Visual Basic Developer Support
> >> Email : (E-Mail Removed) <Remove word online. from address>
> >>
> >> This posting is provided "AS IS", with no warranties, and confers no

> >rights.
> >>
> >>
> >>
> >>
> >> --------------------
> >> >Reply-To: "hs" <(E-Mail Removed)>
> >> >From: "hs" <(E-Mail Removed)>
> >> >Subject: DataSet.ReadXml is very slow
> >> >Date: Wed, 23 Jul 2003 15:31:32 +0100
> >> >Lines: 23
> >> >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.adonet
> >> >NNTP-Posting-Host: mailgate.synergy-logistics.co.uk 62.49.130.162
> >> >Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
> >> >Xref: cpmsftngxa06.phx.gbl

microsoft.public.dotnet.framework.adonet:56527
> >> >X-Tomcat-NG: microsoft.public.dotnet.framework.adonet
> >> >
> >> >Hi
> >> >I'm doing the following code
> >> >
> >> >DataSet ds = new DataSet();
> >> >ds.ReadXml("product.xml"); //product.xml is 3Mb
> >> >//or ds.ReadXml(new FileStream("product.xml", File.Open));
> >> >//or ds.ReadXml(new XmlTextReader(new StringReader("<root>very long
> >> >xml</root>")));
> >> >dataGrid1.DataSource = ds.Tables[0];
> >> >
> >> >the ReadXml method is taking a long time to complete (12 seconds

approx,
> >in
> >> >debug).
> >> >It doesnt matter if I use a XmlTextReader, or a Stream in the ReadXml
> >> >constructor, it still takes about 12 seconds. Can someone tell me how

I
> >> >could improve this speed.
> >> >
> >> >
> >> >thanks
> >> >
> >> >
> >> >
> >> >
> >> >
> >> >
> >>
> >>

> >
> >
> >

>
>



 
Reply With Quote
 
hs
Guest
Posts: n/a
 
      31st Jul 2003
The code as follows
DataSet ds = new DataSet();
ds.ReadXml("product.xml");
dataGrid1.DataSource = ds.Tables[0];

when product.xml = 3000 records ds.ReadXml() takes 11.7 seconds
when product.xml = 2000 records ds.ReadXml() takes 4.2 seconds
when product.xml = 1000 records ds.ReadXml() takes 2.4 seconds

I can't send you a copy of product.xml but it has the following format.
<?xml version="1.0" standalone="yes" ?>
<NewDataSet>
<Table>
<PRO_CODE>XXXX</PRO_CODE>
<PRO_STATUS>00</PRO_STATUS>
<PRO_DESCRIPTION>XXXXXXXXXXXXXX</PRO_DESCRIPTION>
<PRO_SHORT_DESC>XXXXXXXXXX</PRO_SHORT_DESC>
<PRO_OWN_ID>XXXX</PRO_OWN_ID>
<PRO_PRG_CODE>XXXXXXXXXX</PRO_PRG_CODE>
<PRO_PRG_SUB_CODE>XXX</PRO_PRG_SUB_CODE>
<PRO_CLASS>100</PRO_CLASS>
<PRO_VALUE>02</PRO_VALUE>
<PRO_LIFE_COST>10004.0000</PRO_LIFE_COST>
<PRO_TEAM>100</PRO_TEAM>
<PRO_ITEM_GOM_CODE>XXX</PRO_ITEM_GOM_CODE>
<PRO_COM_QTY>0</PRO_COM_QTY>
<PRO_TYPE_HEIGHT>0</PRO_TYPE_HEIGHT>
<PRO_TYPE_WIDTH>0</PRO_TYPE_WIDTH>
<PRO_TYPE_DEPTH>0</PRO_TYPE_DEPTH>
<PRO_TYPE_WEIGHT>0</PRO_TYPE_WEIGHT>
<PRO_EXPIRY_DATE>0</PRO_EXPIRY_DATE>
<PRO_CUSTO_DATE>0</PRO_CUSTO_DATE>
<PRO_SIZEDT_CODE>0</PRO_SIZEDT_CODE>
<PRO_SERIAL_NO>0</PRO_SERIAL_NO>
<PRO_BATCH_ROTAS>01</PRO_BATCH_ROTAS>
<PRO_PUBS_REQUIRED>0</PRO_PUBS_REQUIRED>
<PRO_MAINT_INT>0</PRO_MAINT_IND>
</Table>
....3000 or 2000 or 1000 <Tables all with same format>
</NewDataSet>

My problem is, I have customers who will pull their hair out if any data
appearing on the client takes more than 3 seconds.
On top of this, i'm planning to send the xml as a string via SOAP!
If I return the dataset via SOAP, times are quicker (as I can bind this
dataset to the datagrid immediately). But SOAP itself takes up time
serializing/deserializing etc.

I'm surprised MS never thought about having a "retrieve as needed" approach
(where you send only a fraction of the requested data (say only 50 records),
display it and then go back getting the rest in the background...or
something like this).
My customers see the information on screen instantly, thinking its the
worlds fastest software using the internet/intranet, and we're all happy. If
i could create something like this, then i probably wouldn't would be
asking for help about why readxml takes so long.


"Scot Rose [MSFT]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> That is still a pretty good size text file to be read in (And read in

Sequentially) so it could take a bit of time. Do you have a small sample you
could send to me that reproduces this
> behavior? I'd be glad to take a look at it and see if I can get a handle

on whether or not this would be considered a 'normal' amount of time for
this operation or not. Also, IF the file
> were say, 1500 records instead of 3000 does it take exactly half as long

to load? (6 seconds instead of 12). In other words, does there apppear to be
a pattern, say 1000 records
> takes 4 seconds, 2000 takes 8.. etc...
>
> Want to know more? Check out the MSDN Library at http://msdn.microsoft.com

or the Microsoft Knowledge Base at http://support.microsoft.com
>
> Scot Rose, MCSD
> Microsoft Visual Basic Developer Support
> Email : (E-Mail Removed) <Remove word online. from address>
>
> This posting is provided "AS IS", with no warranties, and confers no

rights.
>
>
>
>
> --------------------
> >Reply-To: "hs" <(E-Mail Removed)>
> >From: "hs" <(E-Mail Removed)>
> >References: <(E-Mail Removed)>

<(E-Mail Removed)>
<u4Vgp#(E-Mail Removed)>
> <(E-Mail Removed)>
> >Subject: Re: DataSet.ReadXml is very slow
> >Date: Mon, 28 Jul 2003 08:53:07 +0100
> >Lines: 141
> >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.adonet
> >NNTP-Posting-Host: mailgate.synergy-logistics.co.uk 62.49.130.162
> >Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09.phx.gbl
> >Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.adonet:56837
> >X-Tomcat-NG: microsoft.public.dotnet.framework.adonet
> >
> >Hi Scott,
> >It doesn't take that long to write out the xml (about 1-2 seconds). Most

of
> >the fields are strings, some are datetimes but no binary or longs. There

are
> >some ints as well.
> >The table the dataset is reading (ds.ReadXml) has about 30 fields per
> >datarow. An end user probably wouldn't request this much information but

i
> >am trying out the worst case scenario.
> >
> >
> >thanks
> >
> >
> >
> >"Scot Rose [MSFT]" <(E-Mail Removed)> wrote in message
> >news:(E-Mail Removed)...
> >> I missed that<G> 3mb is a pretty large file for only 3000 records. Are

> >some of the fields Long text fields or Binary fields? How long does it

take
> >to write out the XMLin the fist place?
> >>
> >> Want to know more? Check out the MSDN Library at

http://msdn.microsoft.com
> >or the Microsoft Knowledge Base at http://support.microsoft.com
> >>
> >> Scot Rose, MCSD
> >> Microsoft Visual Basic Developer Support
> >> Email : (E-Mail Removed) <Remove word online. from address>
> >>
> >> This posting is provided "AS IS", with no warranties, and confers no

> >rights.
> >>
> >>
> >>
> >>
> >> --------------------
> >> >Reply-To: "hs" <(E-Mail Removed)>
> >> >From: "hs" <(E-Mail Removed)>
> >> >References: <(E-Mail Removed)>

> ><(E-Mail Removed)>
> >> >Subject: Re: DataSet.ReadXml is very slow
> >> >Date: Thu, 24 Jul 2003 15:27:05 +0100
> >> >Lines: 77
> >> >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: <u4Vgp#(E-Mail Removed)>
> >> >Newsgroups: microsoft.public.dotnet.framework.adonet
> >> >NNTP-Posting-Host: mailgate.synergy-logistics.co.uk 62.49.130.162
> >> >Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11.phx.gbl
> >> >Xref: cpmsftngxa06.phx.gbl

microsoft.public.dotnet.framework.adonet:56632
> >> >X-Tomcat-NG: microsoft.public.dotnet.framework.adonet
> >> >
> >> >Hi Scot
> >> >product.xml, a file i created using DataSet.WriteXml(), is about 3Mb

(i
> >> >mentioned this in my first post) and is 3000 records approximately

(which
> >i
> >> >didn't mention).
> >> >I've looked at alot of links on msdn but can't find anything about my

> >issue.
> >> >
> >> >thanks
> >> >
> >> >
> >> >
> >> >"Scot Rose [MSFT]" <(E-Mail Removed)> wrote in message
> >> >news:(E-Mail Removed)...
> >> >> You have given no information about the size of the XML (How many

rows
> >are
> >> >we talking about?) For a small file , 12 seconds may be a long time,

for
> >a
> >> >large file it might be really
> >> >> good... WIthout that information as a frame of reference it is hard

to
> >> >determine either way.
> >> >>
> >> >> Want to know more? Check out the MSDN Library at

> >http://msdn.microsoft.com
> >> >or the Microsoft Knowledge Base at http://support.microsoft.com
> >> >>
> >> >> Scot Rose, MCSD
> >> >> Microsoft Visual Basic Developer Support
> >> >> Email : (E-Mail Removed) <Remove word online. from

address>
> >> >>
> >> >> This posting is provided "AS IS", with no warranties, and confers no
> >> >rights.
> >> >>
> >> >>
> >> >>
> >> >>
> >> >> --------------------
> >> >> >Reply-To: "hs" <(E-Mail Removed)>
> >> >> >From: "hs" <(E-Mail Removed)>
> >> >> >Subject: DataSet.ReadXml is very slow
> >> >> >Date: Wed, 23 Jul 2003 15:31:32 +0100
> >> >> >Lines: 23
> >> >> >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.adonet
> >> >> >NNTP-Posting-Host: mailgate.synergy-logistics.co.uk 62.49.130.162
> >> >> >Path:

cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
> >> >> >Xref: cpmsftngxa06.phx.gbl

> >microsoft.public.dotnet.framework.adonet:56527
> >> >> >X-Tomcat-NG: microsoft.public.dotnet.framework.adonet
> >> >> >
> >> >> >Hi
> >> >> >I'm doing the following code
> >> >> >
> >> >> >DataSet ds = new DataSet();
> >> >> >ds.ReadXml("product.xml"); //product.xml is 3Mb
> >> >> >//or ds.ReadXml(new FileStream("product.xml", File.Open));
> >> >> >//or ds.ReadXml(new XmlTextReader(new StringReader("<root>very long
> >> >> >xml</root>")));
> >> >> >dataGrid1.DataSource = ds.Tables[0];
> >> >> >
> >> >> >the ReadXml method is taking a long time to complete (12 seconds

> >approx,
> >> >in
> >> >> >debug).
> >> >> >It doesnt matter if I use a XmlTextReader, or a Stream in the

ReadXml
> >> >> >constructor, it still takes about 12 seconds. Can someone tell me

how
> >I
> >> >> >could improve this speed.
> >> >> >
> >> >> >
> >> >> >thanks
> >> >> >
> >> >> >
> >> >> >
> >> >> >
> >> >> >
> >> >> >
> >> >>
> >> >>
> >> >
> >> >
> >> >
> >>
> >>

> >
> >
> >

>
>



 
Reply With Quote
 
Scot Rose [MSFT]
Guest
Posts: n/a
 
      31st Jul 2003
One thing to keep in mind when designing, ADO.Net was designed and optimized for SMALL recordsets, performance takes a hit with more than a few hundred records, and this is
probably what you are seeing. Unfortuanately The internet doesn't make something like an Asyncronous access like you mentioned practicle. Now IF you were using Client side
code you could build the recordet by retrieiving the first 50 then the others after populating the controls, then just add additional info to the dataset, but this isn't going to work on
ASPX or other serverside code, but coding this would be up to you, no provision was built into ADOX for this (You could always suggest that as a feature request at the feedback
site)

http://register.microsoft.com/mswish...2Fthanks%2Ehtm

Want to know more? Check out the MSDN Library at http://msdn.microsoft.com or the Microsoft Knowledge Base at http://support.microsoft.com

Scot Rose, MCSD
Microsoft Visual Basic Developer Support
Email : (E-Mail Removed) <Remove word online. from address>

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




--------------------
>Reply-To: "hs" <(E-Mail Removed)>
>From: "hs" <(E-Mail Removed)>
>References: <(E-Mail Removed)> <(E-Mail Removed)> <u4Vgp#(E-Mail Removed)>

<(E-Mail Removed)> <(E-Mail Removed)> <(E-Mail Removed)>
>Subject: Re: DataSet.ReadXml is very slow
>Date: Thu, 31 Jul 2003 10:36:25 +0100
>Lines: 266
>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.adonet
>NNTP-Posting-Host: mailgate.synergy-logistics.co.uk 62.49.130.162
>Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09.phx.gbl
>Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.adonet:57121
>X-Tomcat-NG: microsoft.public.dotnet.framework.adonet
>
>The code as follows
>DataSet ds = new DataSet();
>ds.ReadXml("product.xml");
>dataGrid1.DataSource = ds.Tables[0];
>
>when product.xml = 3000 records ds.ReadXml() takes 11.7 seconds
>when product.xml = 2000 records ds.ReadXml() takes 4.2 seconds
>when product.xml = 1000 records ds.ReadXml() takes 2.4 seconds
>
>I can't send you a copy of product.xml but it has the following format.
> <?xml version="1.0" standalone="yes" ?>
> <NewDataSet>
> <Table>
> <PRO_CODE>XXXX</PRO_CODE>
> <PRO_STATUS>00</PRO_STATUS>
> <PRO_DESCRIPTION>XXXXXXXXXXXXXX</PRO_DESCRIPTION>
> <PRO_SHORT_DESC>XXXXXXXXXX</PRO_SHORT_DESC>
> <PRO_OWN_ID>XXXX</PRO_OWN_ID>
> <PRO_PRG_CODE>XXXXXXXXXX</PRO_PRG_CODE>
> <PRO_PRG_SUB_CODE>XXX</PRO_PRG_SUB_CODE>
> <PRO_CLASS>100</PRO_CLASS>
> <PRO_VALUE>02</PRO_VALUE>
> <PRO_LIFE_COST>10004.0000</PRO_LIFE_COST>
> <PRO_TEAM>100</PRO_TEAM>
> <PRO_ITEM_GOM_CODE>XXX</PRO_ITEM_GOM_CODE>
> <PRO_COM_QTY>0</PRO_COM_QTY>
> <PRO_TYPE_HEIGHT>0</PRO_TYPE_HEIGHT>
> <PRO_TYPE_WIDTH>0</PRO_TYPE_WIDTH>
> <PRO_TYPE_DEPTH>0</PRO_TYPE_DEPTH>
> <PRO_TYPE_WEIGHT>0</PRO_TYPE_WEIGHT>
> <PRO_EXPIRY_DATE>0</PRO_EXPIRY_DATE>
> <PRO_CUSTO_DATE>0</PRO_CUSTO_DATE>
> <PRO_SIZEDT_CODE>0</PRO_SIZEDT_CODE>
> <PRO_SERIAL_NO>0</PRO_SERIAL_NO>
> <PRO_BATCH_ROTAS>01</PRO_BATCH_ROTAS>
> <PRO_PUBS_REQUIRED>0</PRO_PUBS_REQUIRED>
> <PRO_MAINT_INT>0</PRO_MAINT_IND>
> </Table>
> ....3000 or 2000 or 1000 <Tables all with same format>
></NewDataSet>
>
>My problem is, I have customers who will pull their hair out if any data
>appearing on the client takes more than 3 seconds.
>On top of this, i'm planning to send the xml as a string via SOAP!
>If I return the dataset via SOAP, times are quicker (as I can bind this
>dataset to the datagrid immediately). But SOAP itself takes up time
>serializing/deserializing etc.
>
>I'm surprised MS never thought about having a "retrieve as needed" approach
>(where you send only a fraction of the requested data (say only 50 records),
>display it and then go back getting the rest in the background...or
>something like this).
>My customers see the information on screen instantly, thinking its the
>worlds fastest software using the internet/intranet, and we're all happy. If
>i could create something like this, then i probably wouldn't would be
>asking for help about why readxml takes so long.
>
>
>"Scot Rose [MSFT]" <(E-Mail Removed)> wrote in message
>news:(E-Mail Removed)...
>> That is still a pretty good size text file to be read in (And read in

>Sequentially) so it could take a bit of time. Do you have a small sample you
>could send to me that reproduces this
>> behavior? I'd be glad to take a look at it and see if I can get a handle

>on whether or not this would be considered a 'normal' amount of time for
>this operation or not. Also, IF the file
>> were say, 1500 records instead of 3000 does it take exactly half as long

>to load? (6 seconds instead of 12). In other words, does there apppear to be
>a pattern, say 1000 records
>> takes 4 seconds, 2000 takes 8.. etc...
>>
>> Want to know more? Check out the MSDN Library at http://msdn.microsoft.com

>or the Microsoft Knowledge Base at http://support.microsoft.com
>>
>> Scot Rose, MCSD
>> Microsoft Visual Basic Developer Support
>> Email : (E-Mail Removed) <Remove word online. from address>
>>
>> This posting is provided "AS IS", with no warranties, and confers no

>rights.
>>
>>
>>
>>
>> --------------------
>> >Reply-To: "hs" <(E-Mail Removed)>
>> >From: "hs" <(E-Mail Removed)>
>> >References: <(E-Mail Removed)>

><(E-Mail Removed)>
><u4Vgp#(E-Mail Removed)>
>> <(E-Mail Removed)>
>> >Subject: Re: DataSet.ReadXml is very slow
>> >Date: Mon, 28 Jul 2003 08:53:07 +0100
>> >Lines: 141
>> >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.adonet
>> >NNTP-Posting-Host: mailgate.synergy-logistics.co.uk 62.49.130.162
>> >Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09.phx.gbl
>> >Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.adonet:56837
>> >X-Tomcat-NG: microsoft.public.dotnet.framework.adonet
>> >
>> >Hi Scott,
>> >It doesn't take that long to write out the xml (about 1-2 seconds). Most

>of
>> >the fields are strings, some are datetimes but no binary or longs. There

>are
>> >some ints as well.
>> >The table the dataset is reading (ds.ReadXml) has about 30 fields per
>> >datarow. An end user probably wouldn't request this much information but

>i
>> >am trying out the worst case scenario.
>> >
>> >
>> >thanks
>> >
>> >
>> >
>> >"Scot Rose [MSFT]" <(E-Mail Removed)> wrote in message
>> >news:(E-Mail Removed)...
>> >> I missed that<G> 3mb is a pretty large file for only 3000 records. Are
>> >some of the fields Long text fields or Binary fields? How long does it

>take
>> >to write out the XMLin the fist place?
>> >>
>> >> Want to know more? Check out the MSDN Library at

>http://msdn.microsoft.com
>> >or the Microsoft Knowledge Base at http://support.microsoft.com
>> >>
>> >> Scot Rose, MCSD
>> >> Microsoft Visual Basic Developer Support
>> >> Email : (E-Mail Removed) <Remove word online. from address>
>> >>
>> >> This posting is provided "AS IS", with no warranties, and confers no
>> >rights.
>> >>
>> >>
>> >>
>> >>
>> >> --------------------
>> >> >Reply-To: "hs" <(E-Mail Removed)>
>> >> >From: "hs" <(E-Mail Removed)>
>> >> >References: <(E-Mail Removed)>
>> ><(E-Mail Removed)>
>> >> >Subject: Re: DataSet.ReadXml is very slow
>> >> >Date: Thu, 24 Jul 2003 15:27:05 +0100
>> >> >Lines: 77
>> >> >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: <u4Vgp#(E-Mail Removed)>
>> >> >Newsgroups: microsoft.public.dotnet.framework.adonet
>> >> >NNTP-Posting-Host: mailgate.synergy-logistics.co.uk 62.49.130.162
>> >> >Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11.phx.gbl
>> >> >Xref: cpmsftngxa06.phx.gbl

>microsoft.public.dotnet.framework.adonet:56632
>> >> >X-Tomcat-NG: microsoft.public.dotnet.framework.adonet
>> >> >
>> >> >Hi Scot
>> >> >product.xml, a file i created using DataSet.WriteXml(), is about 3Mb

>(i
>> >> >mentioned this in my first post) and is 3000 records approximately

>(which
>> >i
>> >> >didn't mention).
>> >> >I've looked at alot of links on msdn but can't find anything about my
>> >issue.
>> >> >
>> >> >thanks
>> >> >
>> >> >
>> >> >
>> >> >"Scot Rose [MSFT]" <(E-Mail Removed)> wrote in message
>> >> >news:(E-Mail Removed)...
>> >> >> You have given no information about the size of the XML (How many

>rows
>> >are
>> >> >we talking about?) For a small file , 12 seconds may be a long time,

>for
>> >a
>> >> >large file it might be really
>> >> >> good... WIthout that information as a frame of reference it is hard

>to
>> >> >determine either way.
>> >> >>
>> >> >> Want to know more? Check out the MSDN Library at
>> >http://msdn.microsoft.com
>> >> >or the Microsoft Knowledge Base at http://support.microsoft.com
>> >> >>
>> >> >> Scot Rose, MCSD
>> >> >> Microsoft Visual Basic Developer Support
>> >> >> Email : (E-Mail Removed) <Remove word online. from

>address>
>> >> >>
>> >> >> This posting is provided "AS IS", with no warranties, and confers no
>> >> >rights.
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >> --------------------
>> >> >> >Reply-To: "hs" <(E-Mail Removed)>
>> >> >> >From: "hs" <(E-Mail Removed)>
>> >> >> >Subject: DataSet.ReadXml is very slow
>> >> >> >Date: Wed, 23 Jul 2003 15:31:32 +0100
>> >> >> >Lines: 23
>> >> >> >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.adonet
>> >> >> >NNTP-Posting-Host: mailgate.synergy-logistics.co.uk 62.49.130.162
>> >> >> >Path:

>cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
>> >> >> >Xref: cpmsftngxa06.phx.gbl
>> >microsoft.public.dotnet.framework.adonet:56527
>> >> >> >X-Tomcat-NG: microsoft.public.dotnet.framework.adonet
>> >> >> >
>> >> >> >Hi
>> >> >> >I'm doing the following code
>> >> >> >
>> >> >> >DataSet ds = new DataSet();
>> >> >> >ds.ReadXml("product.xml"); //product.xml is 3Mb
>> >> >> >//or ds.ReadXml(new FileStream("product.xml", File.Open));
>> >> >> >//or ds.ReadXml(new XmlTextReader(new StringReader("<root>very long
>> >> >> >xml</root>")));
>> >> >> >dataGrid1.DataSource = ds.Tables[0];
>> >> >> >
>> >> >> >the ReadXml method is taking a long time to complete (12 seconds
>> >approx,
>> >> >in
>> >> >> >debug).
>> >> >> >It doesnt matter if I use a XmlTextReader, or a Stream in the

>ReadXml
>> >> >> >constructor, it still takes about 12 seconds. Can someone tell me

>how
>> >I
>> >> >> >could improve this speed.
>> >> >> >
>> >> >> >
>> >> >> >thanks
>> >> >> >
>> >> >> >
>> >> >> >
>> >> >> >
>> >> >> >
>> >> >> >
>> >> >>
>> >> >>
>> >> >
>> >> >
>> >> >
>> >>
>> >>
>> >
>> >
>> >

>>
>>

>
>
>



 
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
DataSet.ReadXml() Jonathan Wood Microsoft ADO .NET 6 4th Aug 2008 01:00 AM
ReadXml() method: standard DataSet vs. typed DataSet MikeOtown Microsoft ADO .NET 0 6th Dec 2007 05:15 PM
DataSet.ReadXml is slow =?Utf-8?B?Sm9obiBPbGJlcnQ=?= Microsoft Dot NET Compact Framework 6 23rd Sep 2005 06:27 PM
Re: does DataSet.ReadXml() clear current table information on DataSet CrunkByte Microsoft Dot NET Framework 0 21st May 2005 03:11 AM
dataset.readxml psb Microsoft Dot NET 0 15th Apr 2004 08:14 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:02 AM.