Polyfill for modern CPU - allfoxwy/UnitXP_SP3 GitHub Wiki
These are some hot spots that I think might help if I rewrite them.
Matrix/Vector calculation is a must for 3D program. The game did it using x87 instructions. Replacing them should result in better CPU utilization and more parallelism.
Blit functions transfer large data from memory to memory. The game's original logic is to use a REP MOVSQ to move large data, then switch to REP MOVSB to finish the tail. This was the optimal solution during 1996 - 2013. However in 2013, Intel deployed Enhanced REP MOVSB. Now REP MOVSB is faster, and it now requires a fixed heating up when it starts. So the original design is flipped. Replacing them with std::memcpy and compile the mod with a modern compiler should fix it.
You could check Enhanced REP MOVSB: 1
to tell if Blit polyfill is enabled:
/run message(UnitXP("performanceProfile", "get"));