raystuttgart
Civ4Col Modder
The issue is not really slow code, but more the fact that the AI calls it over and over. It calculates yields used to make certain professions, like scouts uses 50 horses, 0 lumber etc.
There is nothing touched more often in Civ4Col logic than the logic about professions.
That is why I was extremely reluctant about having new features that add new computation intensive logic about professions.
(e.g. Inventions that change the professions allowed)
I wasn't too happy with the vanilla code to begin with and this certainly didn't improve my impression of it.
Well, I guess all DLL modders share that impression.

The number of professions is now hardcoded into the dll as I needed that info at compiletime. Adding more professions will need a new dll file.
...
I plan to do this with more data from the XML files as knowledge of the numbers at compiletime provides faster code and open up some more coding features.
Well, as a DLL modder, it would probably be quite easy to change that.
But it will be a really bad design decision for others that don't do DLL modding and might be interested to use your modmod for their own private version.
The majority of people that occassionally do modding does not know anything about the DLL.
Thus you might lower interest of others to participate in your project ...
Maybe you might reconsider this.

Would it be possible to have it directly identify the # of professions on the initial load of XML data then store that in a global variable.
Things like that are usually a good idea.

I tried to do that with many XML settings to avoid reading from XML or the relatively slow FVarSystem.
This is one of the main points by which we have increased performance in RaR.