Hi,
I should use XML to synchronize the data from different (VB.NET)
applications, and I was just wondering which Overloads of these functions
( ReadXmlSchema, ReadXml and WriteXml) goes the fastest? I don't think the
ReadXMLSchema would give a lot of difference, but maybe the overlaods of
ReadXml and WriteXml will. Especially with larges files/datatables...
Should I use the IO.Stream? The XmlReader/XmlWriter?
Any help would be really appreciated!
Thanks a lot in advance,
Pieter
The overloads:
Reads the XML schema from the specified Stream into the DataSet.
[Visual Basic] Overloads Public Sub ReadXmlSchema(Stream)
Reads the XML schema from the specified file into the DataSet.
[Visual Basic] Overloads Public Sub ReadXmlSchema(String)
Reads the XML schema from the specified TextReader into the DataSet.
[Visual Basic] Overloads Public Sub ReadXmlSchema(TextReader)
Reads the XML schema from the specified XmlReader into the DataSet.
[Visual Basic] Overloads Public Sub ReadXmlSchema(XmlReader)
Reads XML schema and data into the DataSet using the specified
System.IO.Stream.
[Visual Basic] Overloads Public Function ReadXml(Stream) As XmlReadMode
Reads XML schema and data into the DataSet using the specified file.
[Visual Basic] Overloads Public Function ReadXml(String) As XmlReadMode
Reads XML schema and data into the DataSet using the specified
System.IO.TextReader.
[Visual Basic] Overloads Public Function ReadXml(TextReader) As XmlReadMode
Reads XML schema and data into the DataSet using the specified
System.Xml.XmlReader.
[Visual Basic] Overloads Public Function ReadXml(XmlReader) As XmlReadMode
Reads XML schema and data into the DataSet using the specified
System.IO.Stream and XmlReadMode.
[Visual Basic] Overloads Public Function ReadXml(Stream, XmlReadMode) As
XmlReadMode
Reads XML schema and data into the DataSet using the specified file and
XmlReadMode.
[Visual Basic] Overloads Public Function ReadXml(String, XmlReadMode) As
XmlReadMode
Reads XML schema and data into the DataSet using the specified
System.IO.TextReader and XmlReadMode.
[Visual Basic] Overloads Public Function ReadXml(TextReader, XmlReadMode) As
XmlReadMode
Reads XML schema and data into the DataSet using the specified
System.Xml.XmlReader and XmlReadMode.
[Visual Basic] Overloads Public Function ReadXml(XmlReader, XmlReadMode) As
XmlReadMode
Writes the current data for the DataSet using the specified
System.IO.Stream.
[Visual Basic] Overloads Public Sub WriteXml(Stream)
Writes the current data for the DataSet to the specified file.
[Visual Basic] Overloads Public Sub WriteXml(String)
Writes the current data for the DataSet using the specified TextWriter.
[Visual Basic] Overloads Public Sub WriteXml(TextWriter)
Writes the current data for the DataSet to the specified XmlWriter.
[Visual Basic] Overloads Public Sub WriteXml(XmlWriter)
Writes the current data, and optionally the schema, for the DataSet using
the specified System.IO.Stream and XmlWriteMode. To write the schema, set
the value for the XMLWriteMode parameter to WriteSchema.
[Visual Basic] Overloads Public Sub WriteXml(Stream, XmlWriteMode)
Writes the current data, and optionally the schema, for the DataSet to the
specified file using the specified XmlWriteMode. To write the schema, set
the value for the XMLWriteMode parameter to WriteSchema.
[Visual Basic] Overloads Public Sub WriteXml(String, XmlWriteMode)
Writes the current data, and optionally the schema, for the DataSet using
the specified TextWriter and XmlWriteMode. To write the schema, set the
value for the XMLWriteMode parameter to WriteSchema.
[Visual Basic] Overloads Public Sub WriteXml(TextWriter, XmlWriteMode)
Writes the current data, and optionally the schema, for the DataSet using
the specified XmlWriter and XmlWriteMode. To write the schema, set the value
for the XMLWriteMode parameter to WriteSchema.
[Visual Basic] Overloads Public Sub WriteXml(XmlWriter, XmlWriteMode) 11 4817
The easiest way to find out is try them.
"DraguVaso" <pi**********@hotmail.com> wrote in message
news:42***********************@news.skynet.be... Hi,
I should use XML to synchronize the data from different (VB.NET) applications, and I was just wondering which Overloads of these functions ( ReadXmlSchema, ReadXml and WriteXml) goes the fastest? I don't think the ReadXMLSchema would give a lot of difference, but maybe the overlaods of ReadXml and WriteXml will. Especially with larges files/datatables...
Should I use the IO.Stream? The XmlReader/XmlWriter?
Any help would be really appreciated!
Thanks a lot in advance,
Pieter
The overloads:
Reads the XML schema from the specified Stream into the DataSet. [Visual Basic] Overloads Public Sub ReadXmlSchema(Stream) Reads the XML schema from the specified file into the DataSet. [Visual Basic] Overloads Public Sub ReadXmlSchema(String) Reads the XML schema from the specified TextReader into the DataSet. [Visual Basic] Overloads Public Sub ReadXmlSchema(TextReader) Reads the XML schema from the specified XmlReader into the DataSet. [Visual Basic] Overloads Public Sub ReadXmlSchema(XmlReader)
Reads XML schema and data into the DataSet using the specified System.IO.Stream. [Visual Basic] Overloads Public Function ReadXml(Stream) As XmlReadMode Reads XML schema and data into the DataSet using the specified file. [Visual Basic] Overloads Public Function ReadXml(String) As XmlReadMode Reads XML schema and data into the DataSet using the specified System.IO.TextReader. [Visual Basic] Overloads Public Function ReadXml(TextReader) As XmlReadMode Reads XML schema and data into the DataSet using the specified System.Xml.XmlReader. [Visual Basic] Overloads Public Function ReadXml(XmlReader) As XmlReadMode Reads XML schema and data into the DataSet using the specified System.IO.Stream and XmlReadMode. [Visual Basic] Overloads Public Function ReadXml(Stream, XmlReadMode) As XmlReadMode Reads XML schema and data into the DataSet using the specified file and XmlReadMode. [Visual Basic] Overloads Public Function ReadXml(String, XmlReadMode) As XmlReadMode Reads XML schema and data into the DataSet using the specified System.IO.TextReader and XmlReadMode. [Visual Basic] Overloads Public Function ReadXml(TextReader, XmlReadMode) As XmlReadMode Reads XML schema and data into the DataSet using the specified System.Xml.XmlReader and XmlReadMode. [Visual Basic] Overloads Public Function ReadXml(XmlReader, XmlReadMode) As XmlReadMode
Writes the current data for the DataSet using the specified System.IO.Stream. [Visual Basic] Overloads Public Sub WriteXml(Stream) Writes the current data for the DataSet to the specified file. [Visual Basic] Overloads Public Sub WriteXml(String) Writes the current data for the DataSet using the specified TextWriter. [Visual Basic] Overloads Public Sub WriteXml(TextWriter) Writes the current data for the DataSet to the specified XmlWriter. [Visual Basic] Overloads Public Sub WriteXml(XmlWriter) Writes the current data, and optionally the schema, for the DataSet using the specified System.IO.Stream and XmlWriteMode. To write the schema, set the value for the XMLWriteMode parameter to WriteSchema. [Visual Basic] Overloads Public Sub WriteXml(Stream, XmlWriteMode) Writes the current data, and optionally the schema, for the DataSet to the specified file using the specified XmlWriteMode. To write the schema, set the value for the XMLWriteMode parameter to WriteSchema. [Visual Basic] Overloads Public Sub WriteXml(String, XmlWriteMode) Writes the current data, and optionally the schema, for the DataSet using the specified TextWriter and XmlWriteMode. To write the schema, set the value for the XMLWriteMode parameter to WriteSchema. [Visual Basic] Overloads Public Sub WriteXml(TextWriter, XmlWriteMode) Writes the current data, and optionally the schema, for the DataSet using the specified XmlWriter and XmlWriteMode. To write the schema, set the value for the XMLWriteMode parameter to WriteSchema. [Visual Basic] Overloads Public Sub WriteXml(XmlWriter, XmlWriteMode)
Thanks, you didn't sleep too well thisn ight I guess? ;-)
It would jsut be nice if anybody couldgive me tha right answer :-) I think
the "Overloads Public Function ReadXml(XmlReader, XmlReadMode) As
XmlReadMode" is the fastets, ot maybe the one without the XmlReadMode, and
using a XmlTextReader.
But there are different ways to open the XmlTextReader, and different ways
for the xmlReadMode, etc...
So this makes the total to hundreds of ways to do it. so testing one after
another would take to much time. I just hink there mya be a 'right' solution
out there...
Pieter
"Stephany Young" <noone@localhost> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl... The easiest way to find out is try them.
"DraguVaso" <pi**********@hotmail.com> wrote in message news:42***********************@news.skynet.be... Hi,
I should use XML to synchronize the data from different (VB.NET) applications, and I was just wondering which Overloads of these
functions ( ReadXmlSchema, ReadXml and WriteXml) goes the fastest? I don't think
the ReadXMLSchema would give a lot of difference, but maybe the overlaods of ReadXml and WriteXml will. Especially with larges files/datatables...
Should I use the IO.Stream? The XmlReader/XmlWriter?
Any help would be really appreciated!
Thanks a lot in advance,
Pieter
The overloads:
Reads the XML schema from the specified Stream into the DataSet. [Visual Basic] Overloads Public Sub ReadXmlSchema(Stream) Reads the XML schema from the specified file into the DataSet. [Visual Basic] Overloads Public Sub ReadXmlSchema(String) Reads the XML schema from the specified TextReader into the DataSet. [Visual Basic] Overloads Public Sub ReadXmlSchema(TextReader) Reads the XML schema from the specified XmlReader into the DataSet. [Visual Basic] Overloads Public Sub ReadXmlSchema(XmlReader)
Reads XML schema and data into the DataSet using the specified System.IO.Stream. [Visual Basic] Overloads Public Function ReadXml(Stream) As XmlReadMode Reads XML schema and data into the DataSet using the specified file. [Visual Basic] Overloads Public Function ReadXml(String) As XmlReadMode Reads XML schema and data into the DataSet using the specified System.IO.TextReader. [Visual Basic] Overloads Public Function ReadXml(TextReader) As XmlReadMode Reads XML schema and data into the DataSet using the specified System.Xml.XmlReader. [Visual Basic] Overloads Public Function ReadXml(XmlReader) As
XmlReadMode Reads XML schema and data into the DataSet using the specified System.IO.Stream and XmlReadMode. [Visual Basic] Overloads Public Function ReadXml(Stream, XmlReadMode) As XmlReadMode Reads XML schema and data into the DataSet using the specified file and XmlReadMode. [Visual Basic] Overloads Public Function ReadXml(String, XmlReadMode) As XmlReadMode Reads XML schema and data into the DataSet using the specified System.IO.TextReader and XmlReadMode. [Visual Basic] Overloads Public Function ReadXml(TextReader,
XmlReadMode) As XmlReadMode Reads XML schema and data into the DataSet using the specified System.Xml.XmlReader and XmlReadMode. [Visual Basic] Overloads Public Function ReadXml(XmlReader, XmlReadMode) As XmlReadMode
Writes the current data for the DataSet using the specified System.IO.Stream. [Visual Basic] Overloads Public Sub WriteXml(Stream) Writes the current data for the DataSet to the specified file. [Visual Basic] Overloads Public Sub WriteXml(String) Writes the current data for the DataSet using the specified TextWriter. [Visual Basic] Overloads Public Sub WriteXml(TextWriter) Writes the current data for the DataSet to the specified XmlWriter. [Visual Basic] Overloads Public Sub WriteXml(XmlWriter) Writes the current data, and optionally the schema, for the DataSet
using the specified System.IO.Stream and XmlWriteMode. To write the schema,
set the value for the XMLWriteMode parameter to WriteSchema. [Visual Basic] Overloads Public Sub WriteXml(Stream, XmlWriteMode) Writes the current data, and optionally the schema, for the DataSet to
the specified file using the specified XmlWriteMode. To write the schema,
set the value for the XMLWriteMode parameter to WriteSchema. [Visual Basic] Overloads Public Sub WriteXml(String, XmlWriteMode) Writes the current data, and optionally the schema, for the DataSet
using the specified TextWriter and XmlWriteMode. To write the schema, set the value for the XMLWriteMode parameter to WriteSchema. [Visual Basic] Overloads Public Sub WriteXml(TextWriter, XmlWriteMode) Writes the current data, and optionally the schema, for the DataSet
using the specified XmlWriter and XmlWriteMode. To write the schema, set the value for the XMLWriteMode parameter to WriteSchema. [Visual Basic] Overloads Public Sub WriteXml(XmlWriter, XmlWriteMode)
So you expect others to try it out for you and report back?
If you are too lazy to try write a few lines of code and try it for
yourself, then you aren't going to learn much.
"DraguVaso" <pi**********@hotmail.com> wrote in message
news:42*********************@news.skynet.be... Thanks, you didn't sleep too well thisn ight I guess? ;-)
It would jsut be nice if anybody couldgive me tha right answer :-) I think the "Overloads Public Function ReadXml(XmlReader, XmlReadMode) As XmlReadMode" is the fastets, ot maybe the one without the XmlReadMode, and using a XmlTextReader. But there are different ways to open the XmlTextReader, and different ways for the xmlReadMode, etc...
So this makes the total to hundreds of ways to do it. so testing one after another would take to much time. I just hink there mya be a 'right' solution out there...
Pieter
"Stephany Young" <noone@localhost> wrote in message news:%2****************@TK2MSFTNGP10.phx.gbl... The easiest way to find out is try them.
"DraguVaso" <pi**********@hotmail.com> wrote in message news:42***********************@news.skynet.be... > Hi, > > I should use XML to synchronize the data from different (VB.NET) > applications, and I was just wondering which Overloads of these functions > ( ReadXmlSchema, ReadXml and WriteXml) goes the fastest? I don't think the > ReadXMLSchema would give a lot of difference, but maybe the overlaods > of > ReadXml and WriteXml will. Especially with larges files/datatables... > > Should I use the IO.Stream? The XmlReader/XmlWriter? > > Any help would be really appreciated! > > Thanks a lot in advance, > > Pieter > > > The overloads: > > Reads the XML schema from the specified Stream into the DataSet. > [Visual Basic] Overloads Public Sub ReadXmlSchema(Stream) > Reads the XML schema from the specified file into the DataSet. > [Visual Basic] Overloads Public Sub ReadXmlSchema(String) > Reads the XML schema from the specified TextReader into the DataSet. > [Visual Basic] Overloads Public Sub ReadXmlSchema(TextReader) > Reads the XML schema from the specified XmlReader into the DataSet. > [Visual Basic] Overloads Public Sub ReadXmlSchema(XmlReader) > > Reads XML schema and data into the DataSet using the specified > System.IO.Stream. > [Visual Basic] Overloads Public Function ReadXml(Stream) As XmlReadMode > Reads XML schema and data into the DataSet using the specified file. > [Visual Basic] Overloads Public Function ReadXml(String) As XmlReadMode > Reads XML schema and data into the DataSet using the specified > System.IO.TextReader. > [Visual Basic] Overloads Public Function ReadXml(TextReader) As > XmlReadMode > Reads XML schema and data into the DataSet using the specified > System.Xml.XmlReader. > [Visual Basic] Overloads Public Function ReadXml(XmlReader) As XmlReadMode > Reads XML schema and data into the DataSet using the specified > System.IO.Stream and XmlReadMode. > [Visual Basic] Overloads Public Function ReadXml(Stream, XmlReadMode) > As > XmlReadMode > Reads XML schema and data into the DataSet using the specified file and > XmlReadMode. > [Visual Basic] Overloads Public Function ReadXml(String, XmlReadMode) > As > XmlReadMode > Reads XML schema and data into the DataSet using the specified > System.IO.TextReader and XmlReadMode. > [Visual Basic] Overloads Public Function ReadXml(TextReader, XmlReadMode) > As > XmlReadMode > Reads XML schema and data into the DataSet using the specified > System.Xml.XmlReader and XmlReadMode. > [Visual Basic] Overloads Public Function ReadXml(XmlReader, > XmlReadMode) > As > XmlReadMode > > > Writes the current data for the DataSet using the specified > System.IO.Stream. > [Visual Basic] Overloads Public Sub WriteXml(Stream) > Writes the current data for the DataSet to the specified file. > [Visual Basic] Overloads Public Sub WriteXml(String) > Writes the current data for the DataSet using the specified TextWriter. > [Visual Basic] Overloads Public Sub WriteXml(TextWriter) > Writes the current data for the DataSet to the specified XmlWriter. > [Visual Basic] Overloads Public Sub WriteXml(XmlWriter) > Writes the current data, and optionally the schema, for the DataSet using > the specified System.IO.Stream and XmlWriteMode. To write the schema, set > the value for the XMLWriteMode parameter to WriteSchema. > [Visual Basic] Overloads Public Sub WriteXml(Stream, XmlWriteMode) > Writes the current data, and optionally the schema, for the DataSet to the > specified file using the specified XmlWriteMode. To write the schema, set > the value for the XMLWriteMode parameter to WriteSchema. > [Visual Basic] Overloads Public Sub WriteXml(String, XmlWriteMode) > Writes the current data, and optionally the schema, for the DataSet using > the specified TextWriter and XmlWriteMode. To write the schema, set the > value for the XMLWriteMode parameter to WriteSchema. > [Visual Basic] Overloads Public Sub WriteXml(TextWriter, XmlWriteMode) > Writes the current data, and optionally the schema, for the DataSet using > the specified XmlWriter and XmlWriteMode. To write the schema, set the > value > for the XMLWriteMode parameter to WriteSchema. > [Visual Basic] Overloads Public Sub WriteXml(XmlWriter, XmlWriteMode) > > >
Hehehe :-) You really didn't sleep too wel did you? :-)
So you are convinced that evrybody who's asking something on a newsgroup is
just too lazy to search him/herself, and hopes somebody else is going to
work for him/her? I think that says a lot more about you than it does about
me...
:-)
Nevertheless, I don't think that's the appropriate place to have discussions
like this, so it would still be fine if somebody could confirm/reject my
supposition?
thanks,
Pieter
"Stephany Young" <noone@localhost> wrote in message
news:O9**************@TK2MSFTNGP09.phx.gbl... So you expect others to try it out for you and report back?
If you are too lazy to try write a few lines of code and try it for yourself, then you aren't going to learn much.
"DraguVaso" <pi**********@hotmail.com> wrote in message news:42*********************@news.skynet.be... Thanks, you didn't sleep too well thisn ight I guess? ;-)
It would jsut be nice if anybody couldgive me tha right answer :-) I
think the "Overloads Public Function ReadXml(XmlReader, XmlReadMode) As XmlReadMode" is the fastets, ot maybe the one without the XmlReadMode,
and using a XmlTextReader. But there are different ways to open the XmlTextReader, and different
ways for the xmlReadMode, etc...
So this makes the total to hundreds of ways to do it. so testing one
after another would take to much time. I just hink there mya be a 'right' solution out there...
Pieter
"Stephany Young" <noone@localhost> wrote in message news:%2****************@TK2MSFTNGP10.phx.gbl... The easiest way to find out is try them.
"DraguVaso" <pi**********@hotmail.com> wrote in message news:42***********************@news.skynet.be... > Hi, > > I should use XML to synchronize the data from different (VB.NET) > applications, and I was just wondering which Overloads of these functions > ( ReadXmlSchema, ReadXml and WriteXml) goes the fastest? I don't
think the > ReadXMLSchema would give a lot of difference, but maybe the overlaods > of > ReadXml and WriteXml will. Especially with larges files/datatables... > > Should I use the IO.Stream? The XmlReader/XmlWriter? > > Any help would be really appreciated! > > Thanks a lot in advance, > > Pieter > > > The overloads: > > Reads the XML schema from the specified Stream into the DataSet. > [Visual Basic] Overloads Public Sub ReadXmlSchema(Stream) > Reads the XML schema from the specified file into the DataSet. > [Visual Basic] Overloads Public Sub ReadXmlSchema(String) > Reads the XML schema from the specified TextReader into the DataSet. > [Visual Basic] Overloads Public Sub ReadXmlSchema(TextReader) > Reads the XML schema from the specified XmlReader into the DataSet. > [Visual Basic] Overloads Public Sub ReadXmlSchema(XmlReader) > > Reads XML schema and data into the DataSet using the specified > System.IO.Stream. > [Visual Basic] Overloads Public Function ReadXml(Stream) As
XmlReadMode > Reads XML schema and data into the DataSet using the specified file. > [Visual Basic] Overloads Public Function ReadXml(String) As
XmlReadMode > Reads XML schema and data into the DataSet using the specified > System.IO.TextReader. > [Visual Basic] Overloads Public Function ReadXml(TextReader) As > XmlReadMode > Reads XML schema and data into the DataSet using the specified > System.Xml.XmlReader. > [Visual Basic] Overloads Public Function ReadXml(XmlReader) As XmlReadMode > Reads XML schema and data into the DataSet using the specified > System.IO.Stream and XmlReadMode. > [Visual Basic] Overloads Public Function ReadXml(Stream, XmlReadMode) > As > XmlReadMode > Reads XML schema and data into the DataSet using the specified file a
nd > XmlReadMode. > [Visual Basic] Overloads Public Function ReadXml(String, XmlReadMode) > As > XmlReadMode > Reads XML schema and data into the DataSet using the specified > System.IO.TextReader and XmlReadMode. > [Visual Basic] Overloads Public Function ReadXml(TextReader, XmlReadMode) > As > XmlReadMode > Reads XML schema and data into the DataSet using the specified > System.Xml.XmlReader and XmlReadMode. > [Visual Basic] Overloads Public Function ReadXml(XmlReader, > XmlReadMode) > As > XmlReadMode > > > Writes the current data for the DataSet using the specified > System.IO.Stream. > [Visual Basic] Overloads Public Sub WriteXml(Stream) > Writes the current data for the DataSet to the specified file. > [Visual Basic] Overloads Public Sub WriteXml(String) > Writes the current data for the DataSet using the specified
TextWriter. > [Visual Basic] Overloads Public Sub WriteXml(TextWriter) > Writes the current data for the DataSet to the specified XmlWriter. > [Visual Basic] Overloads Public Sub WriteXml(XmlWriter) > Writes the current data, and optionally the schema, for the DataSet using > the specified System.IO.Stream and XmlWriteMode. To write the schema, set > the value for the XMLWriteMode parameter to WriteSchema. > [Visual Basic] Overloads Public Sub WriteXml(Stream, XmlWriteMode) > Writes the current data, and optionally the schema, for the DataSet
to the > specified file using the specified XmlWriteMode. To write the schema, set > the value for the XMLWriteMode parameter to WriteSchema. > [Visual Basic] Overloads Public Sub WriteXml(String, XmlWriteMode) > Writes the current data, and optionally the schema, for the DataSet using > the specified TextWriter and XmlWriteMode. To write the schema, set
the > value for the XMLWriteMode parameter to WriteSchema. > [Visual Basic] Overloads Public Sub WriteXml(TextWriter,
XmlWriteMode) > Writes the current data, and optionally the schema, for the DataSet using > the specified XmlWriter and XmlWriteMode. To write the schema, set
the > value > for the XMLWriteMode parameter to WriteSchema. > [Visual Basic] Overloads Public Sub WriteXml(XmlWriter, XmlWriteMode) > > >
Pieter,
Although I have as well no answer, what is your source I think that that is
something that you should tell as well?
Internet, DiskFile etc.
Cor
Hi Cor,
Everything allright?
It should be fore the interfacte between a File and a Dataset...
So you have a DataSet, you put it in an Xml-file, send it, and the other
partie just reads ir backin a DataSet.
Pieter
"Cor Ligthert" <no************@planet.nl> wrote in message
news:uR**************@TK2MSFTNGP12.phx.gbl... Pieter,
Although I have as well no answer, what is your source I think that that
is something that you should tell as well?
Internet, DiskFile etc.
Cor
Pieter,
You understand it probably,
I never took any check to see how fast it is.
I do maximum
\\\
ds.xmlwrite("filepath", XmlWriteMode.WriteSchema)
///
and
\\\
ds.xmlread("filepath")
///
By disk IO, do I never think what is fast, most time is consumed by that
disk itself.
Just my thought,
Cor
One point I found out recently is that if you are using a
XmlValidatingReader and you are processing more than one file of the same
type, then it's definitely worthwhile building an XmlSchemaCollection and
passing that to the validating reader.
In my test suite, this saved over 60Mb of memory allocations.
Paul
"Cor Ligthert" <no************@planet.nl> wrote in message
news:%2***************@TK2MSFTNGP14.phx.gbl... Pieter,
You understand it probably,
I never took any check to see how fast it is. I do maximum
\\\ ds.xmlwrite("filepath", XmlWriteMode.WriteSchema) /// and
\\\ ds.xmlread("filepath") ///
By disk IO, do I never think what is fast, most time is consumed by that disk itself.
Just my thought,
Cor
Dragu,
| Should I use the IO.Stream? The XmlReader/XmlWriter?
I would recommend the one that is appropriate to what you are doing! If you
only have a path in a string, I would recommend ReadXmlSchema(String), if
you already has a Stream I would recommend ReadXmlSchema(Stream),
I would not be concerned about "which goes the fastest" until that routine
is proven to be a performance problem (via profiling with CLR profiler or
similar tool).
As I would expect the methods to be implemented in terms of each other,
specifically in terms of ReadXmlSchema(XmlReader) being the one that is
ultimately used.
In other words I would expect the implementation to be something like:
Sub ReadXmlSchema(ByVal fileName As String)
Dim reader As New XmlTextReader(fileName)
Try
ReadXmlSchema(reader)
Finally
reader.Close()
End Try
End Sub
Sub ReadXmlSchema(ByVal stream As Stream)
Dim reader As New XmlTextReader(stream)
Try
ReadXmlSchema(reader)
Finally
reader.Close()
End Try
End Sub
Sub ReadXmlSchema(ByVal reader As TextReader)
Dim xmlReader As New XmlTextReader(reader)
Try
ReadXmlSchema(reader)
Finally
reader.Close()
End Try
End Sub
Sub ReadXmlSchema(ByVal reader As XmlReader)
' actually read the Xml Schema from...
End Sub
Of course there is also the 80/20 rule. That is 80% of the execution time of
your program is spent in 20% of your code. I will optimize (worry about
performance, memory consumption) the 20% once that 20% has been identified &
proven to be a performance problem via profiling (CLR Profiler is one
profiling tool).
For info on the 80/20 rule & optimizing only the 20% see Martin Fowler's
article "Yet Another Optimization Article" at http://martinfowler.com/ieeeSoftware...timization.pdf
Further as Paul suggests, based on the options you use to create the
parameters (such as creating an XmlValidatingReader instead of a
XmlTextReader) your performance will vary. So as Stephany suggests you
really need to try them in the context of your program to see which is
faster!
Also rather then worry about which is faster per se I would consider where I
was writing to & reading from. For example can I afford to load the schema
once & keep it in a MemoryStream or a String & pass a MemoryStream to
ReadXmlSchema(Steam), or StringReader to ReadXmlSchema(TextReader) instead
of saving & reading from disk... Which now becomes a question of how the
data is "transmitted" between the applications. Disk, NetworkStream,
Clipboard, other...
Hope this helps
Jay
"DraguVaso" <pi**********@hotmail.com> wrote in message
news:42***********************@news.skynet.be...
| Hi,
|
| I should use XML to synchronize the data from different (VB.NET)
| applications, and I was just wondering which Overloads of these functions
| ( ReadXmlSchema, ReadXml and WriteXml) goes the fastest? I don't think the
| ReadXMLSchema would give a lot of difference, but maybe the overlaods of
| ReadXml and WriteXml will. Especially with larges files/datatables...
|
| Should I use the IO.Stream? The XmlReader/XmlWriter?
|
| Any help would be really appreciated!
|
| Thanks a lot in advance,
|
| Pieter
|
|
| The overloads:
|
| Reads the XML schema from the specified Stream into the DataSet.
| [Visual Basic] Overloads Public Sub ReadXmlSchema(Stream)
| Reads the XML schema from the specified file into the DataSet.
| [Visual Basic] Overloads Public Sub ReadXmlSchema(String)
| Reads the XML schema from the specified TextReader into the DataSet.
| [Visual Basic] Overloads Public Sub ReadXmlSchema(TextReader)
| Reads the XML schema from the specified XmlReader into the DataSet.
| [Visual Basic] Overloads Public Sub ReadXmlSchema(XmlReader)
|
<<snip>>
Thanks a lot for the nice explication and helpfull hints!
Pieter
"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message
news:Og**************@TK2MSFTNGP14.phx.gbl... Dragu, | Should I use the IO.Stream? The XmlReader/XmlWriter? I would recommend the one that is appropriate to what you are doing! If
you only have a path in a string, I would recommend ReadXmlSchema(String), if you already has a Stream I would recommend ReadXmlSchema(Stream),
I would not be concerned about "which goes the fastest" until that routine is proven to be a performance problem (via profiling with CLR profiler or similar tool).
As I would expect the methods to be implemented in terms of each other, specifically in terms of ReadXmlSchema(XmlReader) being the one that is ultimately used.
In other words I would expect the implementation to be something like:
Sub ReadXmlSchema(ByVal fileName As String) Dim reader As New XmlTextReader(fileName) Try ReadXmlSchema(reader) Finally reader.Close() End Try End Sub
Sub ReadXmlSchema(ByVal stream As Stream) Dim reader As New XmlTextReader(stream) Try ReadXmlSchema(reader) Finally reader.Close() End Try End Sub
Sub ReadXmlSchema(ByVal reader As TextReader) Dim xmlReader As New XmlTextReader(reader) Try ReadXmlSchema(reader) Finally reader.Close() End Try End Sub
Sub ReadXmlSchema(ByVal reader As XmlReader) ' actually read the Xml Schema from... End Sub
Of course there is also the 80/20 rule. That is 80% of the execution time
of your program is spent in 20% of your code. I will optimize (worry about performance, memory consumption) the 20% once that 20% has been identified
& proven to be a performance problem via profiling (CLR Profiler is one profiling tool).
For info on the 80/20 rule & optimizing only the 20% see Martin Fowler's article "Yet Another Optimization Article" at http://martinfowler.com/ieeeSoftware...timization.pdf Further as Paul suggests, based on the options you use to create the parameters (such as creating an XmlValidatingReader instead of a XmlTextReader) your performance will vary. So as Stephany suggests you really need to try them in the context of your program to see which is faster!
Also rather then worry about which is faster per se I would consider where
I was writing to & reading from. For example can I afford to load the schema once & keep it in a MemoryStream or a String & pass a MemoryStream to ReadXmlSchema(Steam), or StringReader to ReadXmlSchema(TextReader) instead of saving & reading from disk... Which now becomes a question of how the data is "transmitted" between the applications. Disk, NetworkStream, Clipboard, other...
Hope this helps Jay
"DraguVaso" <pi**********@hotmail.com> wrote in message news:42***********************@news.skynet.be... | Hi, | | I should use XML to synchronize the data from different (VB.NET) | applications, and I was just wondering which Overloads of these
functions | ( ReadXmlSchema, ReadXml and WriteXml) goes the fastest? I don't think
the | ReadXMLSchema would give a lot of difference, but maybe the overlaods of | ReadXml and WriteXml will. Especially with larges files/datatables... | | Should I use the IO.Stream? The XmlReader/XmlWriter? | | Any help would be really appreciated! | | Thanks a lot in advance, | | Pieter | | | The overloads: | | Reads the XML schema from the specified Stream into the DataSet. | [Visual Basic] Overloads Public Sub ReadXmlSchema(Stream) | Reads the XML schema from the specified file into the DataSet. | [Visual Basic] Overloads Public Sub ReadXmlSchema(String) | Reads the XML schema from the specified TextReader into the DataSet. | [Visual Basic] Overloads Public Sub ReadXmlSchema(TextReader) | Reads the XML schema from the specified XmlReader into the DataSet. | [Visual Basic] Overloads Public Sub ReadXmlSchema(XmlReader) | <<snip>>
christ man, one of the whole points of technical newsgroups is to save
time by learning from others' experiences. if someone knows the answer
and is willing to share, why not ask?
if you don't know, all you have to do is not reply. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: DraguVaso |
last post by:
Hi,
I should use XML to synchronize the data from different (VB.NET)
applications, and I was just wondering which Overloads of these functions
( ReadXmlSchema, ReadXml and WriteXml) goes the...
|
by: Tim Nelson |
last post by:
I've got an XML document I am loading into a dataset using
..ReadXml/.ReadXmlSchema. The dataset looks perfect and I can bind it to
a datagrid and elements appear as tables and attributes appear...
|
by: John George |
last post by:
I am writing the file correctly and it gives me the right xml file
When I read it back, I am missing one element in the last row, it sets
it to the initial value before I saved the origional file?...
|
by: C Glenn |
last post by:
I'm attempting to use ReadXml. It's working in that I end up with some
data in the DataSet. But I'm not able to deal with it effectively after
that. The XML file is properly formatted in that it...
|
by: =?Utf-8?B?bXJjc2hhcnBtYW4=?= |
last post by:
Hello,
There is a space(as a data) in one of the columns. And i save my DataTable
as a xml file using DataSet. I used DataSet.WriteXml method to save as a xml
file. Now if I read that .xml file...
|
by: joey.powell |
last post by:
Hello guys, I have a pretty simple app that reads XML data (.ReadXML)
into an in-memory dataset, runs some linq queries, mods the data, and
then writes the XML (.WriteXML) back to disk.
...
|
by: Tony Johansson |
last post by:
Hello!
Assume the following :
1. I create a DataSet with some DataRelation.
2. I then use WriteXml to write the DataSet to an Xml document using
DataRelation.Nested = True
3.I then read the...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| | |