Hi,
I have a DateTime::SpanSet and want to call "contains" on it a lot. At the moment it is performing too slowly for my needs - about 3/10 of a second for each call on a 1GHz G4. Are there any easy speed ups available?
I haven't looked at its implementation closely as I'm a bit pressed for time but my basic problem is I have a "time specification" like "weekdays 9-5, saturdays 9-12, not 11th June 2004" and then a series of CSV files with dates and times in them. I want to read through the CSV files and discard all the records whose date/times fall outside of the time specification.
I'm not sure I have the time but instead of using the SpanSet I was thinking of creating a hash of days of week who's values were arrays of non inter-lapping time intervals. Then I take the date from the CSV file, find its day of week and check its hours in the array. If that will be any faster I don't know. I don't know how slow it is to calculate the day of week from a date either. All dates will be 2004 and later - I don'tr know if I can get any speedups from that. Not sure how I'll deal with things like "not 11th June 2004", i.e things specified by date rather than day, except perhaps keeping a sorted list of them.
Any suggestions?
Thanks,
Andrew