newbie memory question

  • Thread starter Thread starter Neil Wallace
  • Start date Start date
N

Neil Wallace

Hi all,

I have a program for race timing which currently stores to a dataset.
for a variety of reasons, I want to change this to an array.

If I have 500 participants, I will need to store 500 times format
"hh:mm:ss.00" and the order in which they cross the timing points.

so the array will look like

("00:00:04.65", "00:00:10.05", "00:00:18.09", "00:00:22.66", "18")

my question is does the line

Dim resultsArray(500,5) as string

presume that strings could be extremely long and therefore set aside a very
large section of memory?

Is there a more memory efficient way to do this, given that we know the
format of the data beforehand?

thanks

Neil
 
Neil Wallace said:
I have a program for race timing which currently stores to a dataset.
for a variety of reasons, I want to change this to an array.

If I have 500 participants, I will need to store 500 times format
"hh:mm:ss.00" and the order in which they cross the timing points.

so the array will look like

("00:00:04.65", "00:00:10.05", "00:00:18.09", "00:00:22.66", "18")

my question is does the line

Dim resultsArray(500,5) as string

presume that strings could be extremely long and therefore set aside a
very large section of memory?

If you need all the data in memory, then your solution is OK. Maybe it's
better to utilize 'TimeSpan' objects to store the time
spans/durations/timing points instead of using strings to do that. The
optimal solution depends on what you want to do with the data (querying,
adding and removing datasets very often/seldom, ...).
 
Back
Top