I have a function which calculates employee hours in a day. But, it's slow because it considers carry hours and other things.
I figure I can optimize this by caching the hours in a day and only update on change.
I'm looking for something that can quickly do:
Set(date,hours)
HasHoursFor(date)
GetHoursFor(date)
What should I use for this?
I could use a Dictionary
, but I am wondering if there is not some sort of hash way to set, get, and contains quickly.