Hi Eno,
I don't see it in mailing list so resending.
I made the changes we talked about, bt it turns out they probably won't
make a big diff (see attached patch)
The problem is that I have to collect almost always:
XmlReadMode.InferSchema: in order to be able to skip if "schema" is found.
XmlReadMode.Auto: as I don't know what's gonna be.
XmlReadMode.DiffGram: wait for diffgram - very uncommon case, but have a
test (MonoTests.System.Data.DataSetTest.ReadWriteXmlDiffGram).
XmlReadMode.IgnoreSchema: to be able to ignore the schema if it's found.
From the other side in most cases the schema or diffgram element will
be as root or its child, so nothing would be collected anyway.
Regards,
Konstantin Triger
Atsushi Eno wrote:
Hello Konstantin,
Konstantin Triger wrote:
Hi Eno,
I committed the code before I saw your comments on Boris email.
Actually I missed it at all and Boris forwarded it to me. In any case
I didn't want to ignore it and would like, with your help, create the
best implementation possible.
The new implementation solves some bugs, little bit cleaner as it
does not have "gotos", but performs worse. I think that with a very
small effort it can perform better. I really need your help to make
this change safe.
Can you please give your opinion on an assumption that right after
the schema must reside data? If you agree, with a small change I can
make a real perf improvement and we will have a really better
implementation.
I don't think you could quote my post without seeing it. Anyways,
Am not seeing what you see. Maybe it would be the best if you
post testcases that shows why the patch is required. Next, the
patch has several changes in one file. There are things that could
be justified and that might not be. They do not look tied
together, so it is better if they are split.
Without them I don't think any of discussions can go efficiently.
Depending on the testcases that performant way might not be
possible. As long as I know MS.NET implementation is so cheap
that always reads document into DOM or something.
If XML schema is the document root, then there is no data content.
Existing implementation did handle content schema (at least it was
designed to do that) as long as it is the top-level content of the
document element. I am not aware of practical cases that such
schemas in further depth are consumed (since 99.999% of .NET
DataSet users is not likely to have such documents).
Atsushi Eno
--
Regards,
Konstantin Triger
Index: System.Data/DataSet.cs
===================================================================
--- System.Data/DataSet.cs (revision 46217)
+++ System.Data/DataSet.cs (working copy)
@@ -1023,9 +1023,17 @@
continue;
}
- //collect data
- XmlNode n = doc.ReadNode(reader);
- root.AppendChild(n);
+ if (mode == XmlReadMode.InferSchema ||
+ mode == XmlReadMode.Auto ||
+ mode == XmlReadMode.DiffGram ||
+ mode == XmlReadMode.IgnoreSchema) {
+ //collect data
+ XmlNode n = doc.ReadNode(reader);
+ root.AppendChild(n);
+ continue;
+ }
+
+ XmlDataReader.ReadXml (this, reader, mode);
}
if (reader.NodeType == XmlNodeType.EndElement)
_______________________________________________
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list