B
Brian H
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
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