I found one thing that dropped the ReadXml() time for a 26kb Xml file from
over 4 minutes to about 2 seconds. In the code that I am migrating were a
number of secondary threads. They used "WaitHandle.WaitAny()" on secondary
threads to wait for any of a number of events. This is not available under
Netcf or OpenNetcf. I had constructed a "WaitForMultipleObjectsJ1()" as an
extension to the NetOpenCf code that used a WinCE Win32 call
"WaitForMultipleObjects()" to replace the missing "WaitAny()".
Unfortunately the call was always returning immediately with a failure
("invalid pointer"). This meant that the thread (which contained a while
loop) was running full out. I still don't have a replacement for the
"WaitAny()" nor do I yet understand why Win32 "WaitForMultipleObjects()" is
not accepting the handles from a ManualResetEvent object but bypassing the
"for" loop (temporarily) now the ReadXml() works much quicker.
If you have any suggestions on implementing a WaitAny() under Netcf I would
appreciate that information.
Thanks.
--
John Olbert
Ginny Caughey said:
John,
In general, what you're seeing is normal, but the emulator will be a lot
slower than debugging on the actual device, and XML parsing is about twice
as fast in the Compact Framework v2, which is in beta until November 7. You
didn't say if your XML file includes schema, but including schema should
speed up the process a bit.
Ginny Caughey
..NET Compact Framework MVP