I'm currently learning the finer points of Python programming and CivIV modding. One thing I just realized is that pickling (even with the C++ module cPickle) and storing values in the CyGame instance is very slow. And Rhye uses pickling to store a lot of values!
Since I've also read up on Object-Oriented Programming I was able to simply replace a call to one of Rhye's un-pickling functions with storing that value in the class instance. This would seem much more efficient, not?
So it could be possible to optimize RFC quite a bit by taking out some of the most used pickling functions and replacing them with class fields. Like instead of storing the list lStability in the dictionary scriptDict, pickling the whole dictionary, and then saving it in the game instance - it could simply be a field of the Stability class: Stability.lStability (and used like self.lStability).
Makes sense?
Since I've also read up on Object-Oriented Programming I was able to simply replace a call to one of Rhye's un-pickling functions with storing that value in the class instance. This would seem much more efficient, not?
So it could be possible to optimize RFC quite a bit by taking out some of the most used pickling functions and replacing them with class fields. Like instead of storing the list lStability in the dictionary scriptDict, pickling the whole dictionary, and then saving it in the game instance - it could simply be a field of the Stability class: Stability.lStability (and used like self.lStability).
Makes sense?