June 25, 2010
Major refactoring done which will help performance. For the technically inclined, I'm now caching objects that are loaded from the database. What this means is that the first time you load an object (for example Player, Match, Team, LineUp, etc.) it will not load a second instance in memory.
Previously, it was hitting the disk over and over again. For example, if you wanted to simulate a new match, first it would load the match and the lineups into memory. For the lineups it would then load each player into memory. Then, on the simulation screen, it would create new references to these objects and hence result in just a bunch of objects being recreated needlessly. Furthermore, there was a risk if I edited the properties of an object from one scope, it would be overwritten from another scope. This obviously is not a huge issue from the UI perspective since that is impossible, but it's just nice to keep it safe.
The place this is most evident is in the "previous lineup" window. Previously, this window took a long time to load because it had to hit the disk a lot of times. For example, if you had 10 lineups with Tendulkar in it, it would create a .NET object for Tendulkar for each lineup. Now it will just create one .NET object and all the lineups will point back to it.
Theoretically, the only negative to this is higher RAM usage. Since I'm creating each object and holding onto it in the cache, these objects never get deallocated. Realistically, though, since I'm loading each object only once, my RAM usage is probably lower.
This change will be published along with the other changes, post PCCL.