RE: XML/user data...

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Ilya Tumanov [MS] (ilyatum_at_online.microsoft.com)
Date: 04/28/04


Date: Wed, 28 Apr 2004 18:12:15 GMT

Brian,

You can try loading XML on a separate thread, so UI will become responsive
faster.

On the other hand, 7 seconds is not bad at all.
You can easily mask it out by showing splash screen or a wait cursor.

Best regards,

Ilya

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

--------------------
> From: "Brian H" <nospam@nospam.com>
> Subject: XML/user data...
> Date: Tue, 27 Apr 2004 21:33:04 -0700
> Lines: 49
> X-Priority: 3
> X-MSMail-Priority: Normal
> X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
> Message-ID: <euJSnnNLEHA.2692@tk2msftngp13.phx.gbl>
> Newsgroups: microsoft.public.dotnet.framework.compactframework
> NNTP-Posting-Host: 1Cust241.tnt1.sandpoint.id.da.uu.net 65.239.23.241
> Path:
cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13
phx.gbl
> Xref: cpmsftngxa10.phx.gbl
microsoft.public.dotnet.framework.compactframework:51919
> X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework
>
> Hi all,
>
> I'd appreciate some feedback on persisting user-settings.
>
> In my app, I have 3 different XML files that are used to persist data.
I'm
> going nuts to try and lower the load time in my app. Reading the XML
files
> are not TOO bad, but I've done a few very simple benchmarks to get an idea
> as to where my bottleneck is (times are cumulative):
>
> Constructor of main form: several seconds (inherent of .NET apps) +0
> Initialize component, load several objects: +2
> Load all XML files: +5
> Process all settings, load off-screen graphics: +6
> Form_Load called, several other objects instantiated including background
> threads: +7
>
> So this is bad -- 7 seconds until the Form_Load is complete from the time
> the constructor is first hit. If I load the app continously (say,
without a
> reboot) I'll get a bit more favorable result:
>
> Constructor of main form: several seconds (inherent of .NET apps) +0
> Initialize component, load several objects: +2
> Load all XML files: +4
> Process all settings, load off-screen graphics: +5
> Form_Load finished, several other objects instantiated including
background
> threads: +5
>
> So on average, my app takes about 6 seconds after the constructor is hit.
 I
> can shave about 1.5 seconds by lazy-loading a few of my heavier objects
> which I'm already working on. Loading all the XML files takes just under
3
> seconds on average, which is the biggest drain. I've tried reading the
> data: 1) Using the XMLTextReader, 2) Using the DOM to navigate to the
> settings, and 3) Loading the XML into a dataset.
>
> Using the XMLTextReader is (IMO) the crudest method, but the fastest, with
> times of 2.8 seconds, 3.8 seconds, and 4.5 seconds, respectively.
>
> I'm not using many controls at all, it's clear my heavy objects and XML is
> the burden. But what can I do about the XML load times? I'm open to any
> suggestions -- moving to a lightweight database, for example....
> suggestions?
>
> Thanks,
> Brian
>
>
>
>
>
>



Relevant Pages

  • Re: XML document in a treevie needs 57secodns
    ... Using VisualStudio 2005 and C# ... The XML File is 158kb and has the folowing structure: ... Loading the XML DOM using about 40ms ... ... why do you write slow code? ...
    (microsoft.public.dotnet.framework)
  • Re: XML document in a treevie needs 57secodns
    ... Using VisualStudio 2005 and C# ... The XML File is 158kb and has the folowing structure: ... Loading the XML DOM using about 40ms ... ... why do you write slow code? ...
    (microsoft.public.dotnet.framework)
  • RE: Data Insertion
    ... You _have_ to use schema to accomplish that, ... Inference is OK for prototyping and, may be, loading 1-2K XML files; ... Change your XML file to contain embedded schema. ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: ajax, xml and applying xslt
    ... The iframe one would work because it is loading ... transform xml. ... I don't know what made me think a .net web form could ... transform xml on it's own. ...
    (comp.lang.javascript)
  • Re: Aborting the LoadXML method of XmlDocument
    ... >> stoneyowl wrote: ... >>> Is there any way to abort the loading and parsing of a large Xml ... If you need to interrupt I/O operations, ... Use asynchronous I/O to load the XML ...
    (microsoft.public.dotnet.framework)