in reply to Data structure advice

To give a reasonable answer, a few of things need to be more clear. Are you going to load the information in a perl process that will stay alive and process your thousands of lookups? Or does each lookup have to load the data from the .csv file? How many total data points will there be? Will new data be arriving and need to be loaded as you are processing?

Replies are listed 'Best First'.
Re: Re: Data structure advice
by Zed_Lopez (Chaplain) on Jan 05, 2004 at 20:32 UTC

    And, do you only ever care about a single day at a time?

    I'd be tempted to load all the data into a hash, then use a tie interface that computes what the closest preceding data point would be and returns the value corresponding to it.

    As with most questions of this sort, the proof is in the benchmarking, and if you really want to optimize for search speed, you'll want to benchmark.

      Hi Zed,

      I do only care about a single day at a time and, to answer a question from a previous reply, I will be loading all 48 values before processing the many thousands of data points which require the look up.

      The tie interface looks like what I need; I'll have a scout around for information on that. Can you point me at any suitable examples?

      Cheers,

      R.

      --

      Robin Bowes | http://robinbowes.com