473,386 Members | 1,801 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Xml Data Storage

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?

Nov 19 '06 #1
1 1785
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.

--
Dave Sexton

"Ciro" <ci*******@libero.itwrote in message news:Xn********************@twister1.libero.it...
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?

Nov 19 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Scott J. McCaughrin | last post by:
The following program compiles fine but elicits this message from the linker: "undefined reference to VarArray::funct" and thus fails. It seems to behave as if the static data-member:...
7
by: smith4894 | last post by:
Hello, I have a question regarding storage locations for different data types. For example, dynamically created objects (using "new") are created on the heap. local objects ( foo() {int x;} )...
4
by: Ced | last post by:
Hi, i'm not an expert in C but i try to compile BTNG software under linux kernel 2.4.2-2. I get these errors at the very first stage. Does someone could have a rapid look on this and tell me...
6
by: kobu.selva | last post by:
I was recently part of a little debate on the issue of whether constants and string literals are considered "data objects" in C. I'm more confused now than before. I was always under the...
41
by: laimis | last post by:
Hey guys, I just recently got introduced to data mappers (DTO mapper). So now I have a SqlHelper being used by DTOMapper and then business layer is using DTOMapper when it needs to persist...
8
by: Art | last post by:
Hi folks, I'm writing a traditional desktop app using VB.NET and am stumbling over what seems like a very basic question: My app does not need to be connected to a server or another computer....
4
by: Holger Marzen | last post by:
Hi all, AFAIK it is possible for columns to be very large, up to about 2 GB. Are there any hints or experiences about storing binary data (jpg-images, pdf-documents) in PostgrreSQL with or...
12
by: Chris Springer | last post by:
I'd like to get some feedback on the issue of storing data out to disk and where to store it. I've never been in a production environment in programming so you'll have to bear with me... My...
3
by: Atropo | last post by:
Hi, all. As you can see I'm just begining on C. with the tutorial "Sams Teach Yourself C in 24 Hours" as a starter. on aix 5.2 when compiling a helloWorld the gcc throws some warnings the...
10
by: Jeffrey | last post by:
My understanding is that if you write class X { int y; static int z; }; then you've defined (and declared) X and y, but you have only declared (and not defined) z. If you'd like to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.