Too many little fiddly things to explain simply - look at the changes in the SVN revs. The gist is that CvCity::canTrain(UnitCombatTypes eUnitCombat) get called a very great deal when evaluating techs and buildings to check if certain things get enabled by said techs/buildings, and that canTrain check was taking a substantial percentage of total turn time. The main changes were:
1) To make sure the canTrain cache was properly pre-populated and used in the contexts in which this mostly happens
2) To factor out the code that determines if a given unit type has a given combat type into pre-calculated code in CvUniInfo, so it only needs to be run once per load per unit type
3) (not a combat mod thing, but made more significant by it) The pre-amble to canTrain needed (for each unitclass) to determine the unit the particular civ got for that a given unit class, and that involved calling CvCity::getCivilizationType(). That code looked very simple but it turned out that it was called 300 000 000 times per turn (in my GEM game in late Classical), and it unconditionally retrieved a global define. Now, getDefineINT() is not an expensive function, but when we're talking about 300 000 000 calls 'not expensive' takes on a different meaning. I therefore modified that method o essentially cache its result rather than re-querying the global define each time