Actually, this "dog slow" idea is mostly from combination of unrealistic
expectations (e.g. my desktop with 3+GHz superscalar fully featured CPU with
2GB or extremely fast RAM does that in 1 seconds, why it takes 2 minutes on
puny 200 MHz RISC processor with slow 16 bit 32 MB RAM?), older hardware
(e.g. 100MHz PPC 2000), older versions of NETCF (V1 RTM instead of SP2+ or
V2) and improper ways of working with XML (e.g. using inference to load XML
into DataSet or using DOM to get a single value from a big file).
It is very possible to achieve adequate performance on relatively modern
hardware running NETCF V1 SP3 or V2.
With XmlTextReader it should take about a second to read 200K document node
by node.
DataSet.ReadXml() would load it in about 2-3 seconds assuming schema is
used.
This data is for NETCF V2 running in PXA 255@400 MHz on PPC 2003. It's about
twice as long for NETCF V1 SP3.
So, it should be OK to use DataSet.ReadXml() with 200-500K XML.
Just make sure:
- You're using schema (typed DataSet, created programmatically, loaded from
separate file or embedded into the XML).
- Avoid using DateTime fields as they are very slow to parse.
- Use related tables instead of nested tables.
As to saving XML file after each change, simply don't do that. Imagine Word
would save each time you type one character, now that would be terrible.
DataSet is especially designed so you don't have to do that. It cashes data
in memory so you can access and change it as needed and persist it from time
to time.
Save it only on user request, on timer or if your application closes.
And no, there's no way to update part of XML with any class, it can only be
rewritten as a whole.
This is indeed a big disadvantage of XML compared to even comma separated
file; you can at least add records to it which is not possible with XML.
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.compactfra
mework?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).
> Thanks for your help,
>
[quoted text clipped - 10 lines]
>
> Regards
Simon Hart - 05 Jan 2006 20:11 GMT
I wouldn't really call it "unrealistic expectations", I would call it
experience, and testing. I would love to see a 1 second response time
reading a single node from a 200k XML file on any version of CF running on
any processor.
It's really a no brainer, why give yourself so much work when a tool such as
SQL CE does it (and does it a lot better - with more options) without having
to do hardly any work.
> Actually, this "dog slow" idea is mostly from combination of unrealistic
> expectations (e.g. my desktop with 3+GHz superscalar fully featured CPU
[quoted text clipped - 73 lines]
>>
>> Regards
Safae - 09 Jan 2006 14:54 GMT
Thanks for your help.
I'm trying to test both of solutions :Dataset and SQL ce.
about Dataset: I have installed SP2 and load a schema from seperate
file xsd and Im not using DateTimeFields, so Dataset.readXML takes 7s
instead of 28s for reading xml file with 200 Ko. but I dont understand
how can I Use related tables instead of nested tables.
I have one table who has a child table. Should I add PrimaryKey and
foreing Key for those tables in the xsd file ? I have tried to do this
but it generate an exception.
I have already read an utility who reformat The Xml file buy modifing
DataColumn.ColumnMapping to MappingType.Attribute.
what should I do for using related table?
Best Regards
Ilya Tumanov [MS] - 10 Jan 2006 19:36 GMT
You should consider having primary key/foreign keys in any case; it's a must
for any DB.
As to relations, you can change relation type from nested to related in
schema editor.
Also, I've posted source code for utility which does that a while ago.
Should be easy to find using link below.
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.compactfra
mework?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).
> Thanks for your help.
>
[quoted text clipped - 11 lines]
>
> Best Regards