XML schema of 4KB takes 8 seconds to be read

A

Alan Cossey

Hello everyone,,
I have an XML schema file that is read into a dataset using the following
code

ds.ReadXmlSchema(strDataFileSchema)

where ds is the dataset it is going into and strDataFileSchema is the path
for the schema file.

My problem is that it takes 8 seconds to read the thing in. Anyone know why
this might be? I've added the entirety of the file below. It is only 4KB in
size and was created using WriteXMLSchema. The associated data file, at 7KB,
only takes a couple of seconds.

Alan Cossey

<?xml version="1.0" standalone="yes"?>
<xs:schema id="NewDataSet" xmlns=""
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="NewDataSet" msdata:IsDataSet="true"
msdata:Locale="en-GB">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element name="Company">
<xs:complexType>
<xs:sequence>
<xs:element name="Company" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Task">
<xs:complexType>
<xs:sequence>
<xs:element name="TaskRef" type="xs:int" minOccurs="0" />
<xs:element name="TaskDescription" type="xs:string"
minOccurs="0" />
<xs:element name="Company" type="xs:string" minOccurs="0" />
<xs:element name="OpType" type="xs:string" minOccurs="0" />
<xs:element name="Process" type="xs:string" minOccurs="0" />
<xs:element name="SubProcess" type="xs:string" minOccurs="0"
/>
<xs:element name="Location" type="xs:string" minOccurs="0" />
<xs:element name="SubLocation" type="xs:string" minOccurs="0"
/>
<xs:element name="Existing" type="xs:short" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="OpType">
<xs:complexType>
<xs:sequence>
<xs:element name="OpType" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Process">
<xs:complexType>
<xs:sequence>
<xs:element name="Company" type="xs:string" minOccurs="0" />
<xs:element name="Process" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="SubProcess">
<xs:complexType>
<xs:sequence>
<xs:element name="Company" type="xs:string" minOccurs="0" />
<xs:element name="Process" type="xs:string" minOccurs="0" />
<xs:element name="SubProcess" type="xs:string" minOccurs="0"
/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Location">
<xs:complexType>
<xs:sequence>
<xs:element name="Company" type="xs:string" minOccurs="0" />
<xs:element name="Location" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="SubLocation">
<xs:complexType>
<xs:sequence>
<xs:element name="Company" type="xs:string" minOccurs="0" />
<xs:element name="Location" type="xs:string" minOccurs="0" />
<xs:element name="SubLocation" type="xs:string" minOccurs="0"
/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
 
A

Alan Cossey

Peter,
Yes I am. I've not seen this sort of slowness before, either before I
applied SP2 or since. I've tried using attributes in the XML as well, but
that makes no noticeable difference. To make matters more interesting, a
similar read in of an XML schema from a separate file of the same size takes
just a couple of seconds.

Alan
 
I

Ilya Tumanov [MS]

Most likely that's because you're measuring the first pass which includes
JITing time.
Before you can load schema, huge schema code needs to be JIT'ed.
That takes few seconds regardless of the schema size.

Best regards,

Ilya

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

--------------------
 

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