Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / November 2006

Tip: Looking for answers? Try searching our database.

Xml Data Storage

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ciro - 19 Nov 2006 15:04 GMT
Hi Guys, I'm developing an application that sends ICMP echo requests (ping)
via the .net Ping Class. I've some informations related to the network such
as IP addresses,Urls,SiteNames and so stored in a xml file. I need to use
theese informations in my ping method. The ping method will ping the sites
and change the background color property of some shapes I've created.
In the first version of the application I created an Arraylist of all the
Shape Controls an some arrays to store IP Adresses and SiteNames.The arrays
was created at runtime just when the application was started.
So the method had just to iterate throw those arrays.

The question is: Do you think is better to read the values from the xml file
each time I call the ping method (say once per second) or should I retrieve
the values from the file and store them in a Array or Arraylist or whatever?
Which of the two is the better performing way? I guess if I create Arrays
I'll use much more memory but if have to read through the xml structure each
time this would be processor consuming. Is that right?
Dave Sexton - 19 Nov 2006 20:35 GMT
Hi,

> Do you think is better to read the values from the xml file each time I call the ping method (say
> once per second) or should I retrieve the values from the file and store them in a Array or
> Arraylist or whatever?

That all depends on the number of elements.

If the number is quite large then you may want to cache portions in memory, but not the entire
thing.  (i.e., run a timer to release memory that hasn't been used recently)

If the number is small then just store the contents in memory.

The distinction between large and small amounts depend on the capabilities and amount of memory of
the computers that will be running your application.  If you know the capabilities ahead of time it
should make your decision much easier.

> Which of the two is the better performing way?

Memory will perform much better.

> I guess if I create Arrays I'll use much more memory but if have to read through the xml structure
> each time this would be processor consuming. Is that right?

Yes, and not just the processor, but I/O as well; meaning that your HDD will be quite busy serving
up data for ping requests once per second.  You could optimize this by pulling out only the
appropriate data each time without scanning or reading the entire document, but since it's XML that
will probably be very difficult for you.

Signature

Dave Sexton

> Hi Guys, I'm developing an application that sends ICMP echo requests (ping) via the .net Ping
> Class. I've some informations related to the network such as IP addresses,Urls,SiteNames and so
[quoted text clipped - 10 lines]
> create Arrays I'll use much more memory but if have to read through the xml structure each time
> this would be processor consuming. Is that right?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.