On 20 Mar, 02:28, Maddy <mniti...@gmail.comwrote:
Thanks for the ideas. Few things however-
When I said only 10 objects, I meant the entire object. A,B and C
would have about 400 to 500 values. Would have so many values in
memory slow down the app? Should I save them more often to a file?
Secondly each A, B and C need an individual timestamp.
OK - can I just double check what you are describing? In terms of a
visualisation, do you mean:
SomeList [~10 of]
"A"s
int, timstamp pair [~500 of]
"B"s
int, timestamp pair [~500 of]
"C"s
int,int,timestamp triple [~500 of]
or do you mean:
SomeList [~10 of]
Items [~500 of]
timestamp, int "A", int "B", {int/int} "C"
- i.e. are A/B/C timstamped separately, or is it each combination of
an A,B & C that is timstamped.
Also 500 is not a big number. I wouldn't worry about memory - but how
often do you need to seach it for a value (by date)? knowing that
might help pick the most suitable structure. If it is infrequent (i.e.
5s, the only timing in your post) then I wouldn't get excited, and
would just use a List search (as already posted). [In any event, keep
the data in timestamp sequence]
If it is more frequent than this, then perhaps a binary search - or if
you know the data is coming in at regular intervals (every 5s) you
could use interpolation of the query value between the start/end
values to find a first guess and then hunt from here.
Let me know how often you search and I'll try to knock an example
together...
Marc