[Cronometer-development] speed
Brought to you by:
artichikin
|
From: Aaron D. <ada...@po...> - 2005-05-29 03:22:33
|
Did a little snooping on the slow speed -- It's definately just the food loading. It gets worse and worse as you add more and more foods to the daily list. It has to load each one from the database every time it is needed. Adding a food to the day forces all foods in that day to be reloaded from scratch. We could cache loaded foods in a WeakHashMap, and always check it before loading. Just need to make sure it is *always* checked first, so that read/write stale cache conflicts don't occur. What do you think? |