So.
I don't know much about coding.
However I can tell you 2 things:
1) IIRC, RifE is not really quicker than MnAI. I'm not sure you'll find ideas there.
Please note that I have not done any performance tests in RifE (in fact, I have not played it enough to get a feeling of how fast or slow it runs compared against MNAI), but even if RifE as a whole is slower than MNAI that does not mean that all of RifE components are slower than MNAI; some may be slower and some may be faster. Besides that, in computer programs the speed of the program does not depend only in the code itself. It is also important (and usually way more important) the number of data elements to process.
This means that since RifE has a lot more different game elements than MNAI (more spells, more civilizations, more unit classes and so on), RifE is of course going to be more slow than MNAI if we assumed that they could use the same source code. We cannot assume that RifE source code is slower just because the results are slower.
In the spell case, which I mentioned earlier, RifE and MNAI are quite similar. RifE may have additional spell prerrequisites to take into account, but the canCast code is quite similar except for Snarko's performance changes and RifE specific stuff. Since that specific change improved RifE performance, it should also help MNAI performance if it were ported. Since MNAI has less spells, the performance impact would be smaller than in RifE, but since both mods have roughly the same mechanics for spells we would have an improvement nonetheless.
2) I propose that you look into the MoM code.
last christmas, Sephi released a new alpha version which is way quicker than former versions 1.42 (both on load time, interturn and civilopedia access).
you might get some ideas by comparing the codes.
however note that MoM alpha changes many mechanic as compared to MoM 1.42 which itself also has many mechanics very different from MnAI .
However there is IMO more chances to find solutions to FFH related issues here than in completly unrelated mods.
I think that you are overestimating the source code differences between mods. The XML and python parts of mods are vastly different, but the DLL code is quite similar. As long as the performance issues are not directly related to FFH specific features such as spells, most of the performance improvements made in any mod could be adapted to work in MNAI.
What you mention about MoM is very interesting, but I would need more specific pointers to know what parts of the source code I should check. In the distant future, when I'm done with my current proposal and checking K-Mod changes, I'll try to check MoM source code to see if we can find any ideas for improvement. I saw some notes about performance in their commit log.
As a general note, I would also like to mention that for solving performance issues just picking up performance changes from other mods is IMO not the best idea. I think that it is far better to profile MNAI itself, analyze any performance issues that we can find, and then think about possible fixes for the specific MNAI issues. When this point is reached, it is time to check other mods to see if they have solved that particular problem. Once that all obvious performance chokepoints are found, it may be worth the effort to look into general, less specific fixes from other mods that make the source code faster as a whole.