DLL built using the Intel C++ Compiler

alberts8

Emperor
Joined
Aug 16, 2012
Messages
1,967
Hello eyerybody.

For my last games i used DLL's i built with Intel's C++ Compiler to see if there is a Performance impovement and now i want to share them.

Don't expect to much from it but in my current game at turn 878/3030 the next turn using the normal DLL takes 1min14sec and with the one i built with AVX Optimization only 54 seconds.

The DLL is for the SVN Revision 4511!!

You just have to replace the DLL in the Caveman2Cosmos\Assets directory and copy the libmmd.dll and python24.dll to the main Beyond the Sword directory(C:\Program Files (x86)\Firaxis Games\Sid Meier's Civilization 4\Beyond the Sword)
 

Attachments

  • libmmd.7z
    936.5 KB · Views: 125
  • python24.7z
    709.9 KB · Views: 128
I updated the Dll for Svn Revision 4511 and it is now optimized for the following instruction sets CORE-AVX2,CORE-AVX-I,AVX,SSE4.2,SSE4.1,SSSE3,SSE3,SSE2.
 
Thanks for doing that. I would put this in the SVN forum if I were you so it could be added to the base game
 
I tested this on my game (using an intel i7), and the turn times went from 150 sec to 95 sec. That's pretty good for just switching compilers. I don't know though if everyone is going to want to be adding libraries to their core BtS install (cardinal rule: never overwrite core files), but I found the benefit quite large.

Edit: Also, the compiled DLL is about 1.5 times as large as the old one, did you build it in Final_Release? (Release is for profiling)
 
Replacing the python24.dll is not needed but it's a bit faster.

I build it in Final_Release using the Intel C++ Compiler XE 12.1 with all Optimizations exept Auto-Parallelization if someone needs a Release or Debug build i can make one. It's bigger because of the processor specific code paths(AVX,SSE...).
 
Replacing the python24.dll is not needed but it's a bit faster.

I build it in Final_Release using the Intel C++ Compiler XE 12.1 with all Optimizations exept Auto-Parallelization if someone needs a Release or Debug build i can make one. It's bigger because of the processor specific code paths(AVX,SSE...).

Cool. What is the libmmd for?
 
Replacing the python24.dll is not needed but it's a bit faster.

I build it in Final_Release using the Intel C++ Compiler XE 12.1 with all Optimizations exept Auto-Parallelization if someone needs a Release or Debug build i can make one. It's bigger because of the processor specific code paths(AVX,SSE...).

Removing the new python24 DLL had a negligable effect (turn times went from 95 sec to 101 sec), so that would solve the overwrite problem, as the libmmd doesn't overwrite anything.
 
Hello eyerybody.

For my last games i used DLL's i built with Intel's C++ Compiler to see if there is a Performance impovement and now i want to share them.

Don't expect to much from it but in my current game at turn 878/3030 the next turn using the normal DLL takes 1min14sec and with the one i built with AVX Optimization only 54 seconds.

The DLL is for the SVN Revision 4511!!

You just have to replace the DLL in the Caveman2Cosmos\Assets directory and copy the libmmd.dll and python24.dll to the main Beyond the Sword directory(C:\Program Files (x86)\Firaxis Games\Sid Meier's Civilization 4\Beyond the Sword)

How does this effect the ability to do source level debugging in visual studio (I assume it can still generate a pdb?). Also does it compromise debugging info in mini dumps (that is the ability to interpret things like the stack frames at source level) ?
 
Is Intel's program free? Or must we rely on one person who has it for each and every update?

Darn, you're right, it isn't free. That scuttles that plan then. :rolleyes: I should have checked that before pointing out this thread.

Edit: All is not lost though, it seems that the VS2012 compiler does the same thing MSDN link, scroll down to the part about the C++ compiler and linker. I tried getting VS 2012 to compile the DLL, but ran into lots of problems getting the environment variables sorted out and pointing the compiler at the correct SDK. That however is due to my lack of knowledge of VS I suspect, so if someone could get VS 2012 Express to compile the DLL we might see similar performance benefits.
 
How does this effect the ability to do source level debugging in visual studio (I assume it can still generate a pdb?). Also does it compromise debugging info in mini dumps (that is the ability to interpret things like the stack frames at source level) ?

All of this works using the Intel Compiler 11.1 but not with 12.x.

Darn, you're right, it isn't free. That scuttles that plan then. :rolleyes: I should have checked that before pointing out this thread.

Edit: All is not lost though, it seems that the VS2012 compiler does the same thing MSDN link, scroll down to the part about the C++ compiler and linker. I tried getting VS 2012 to compile the DLL, but ran into lots of problems getting the environment variables sorted out and pointing the compiler at the correct SDK. That however is due to my lack of knowledge of VS I suspect, so if someone could get VS 2012 Express to compile the DLL we might see similar performance benefits.

It's not free but i can use it at work.
You can Compile the Dll with a newer MSVC Version but the problem is that the Dll is then built against the newer msvc runtime and you can't mix multiple runtime versions. I even had some problems getting it to work using the Intel Compiler because somehow the Compiler used the Linker from Visual Studio 2010 and the linker always links against the VC10 runtime even then you set the commandline option to ignore the default library.
 
All of this works using the Intel Compiler 11.1 but not with 12.x.



It's not free but i can use it at work.
You can Compile the Dll with a newer MSVC Version but the problem is that the Dll is then built against the newer msvc runtime and you can't mix multiple runtime versions. I even had some problems getting it to work using the Intel Compiler because somehow the Compiler used the Linker from Visual Studio 2010 and the linker always links against the VC10 runtime even then you set the commandline option to ignore the default library.

Well, if you want feel free to keep uploading new DLLs made with the Intel compiler, but for the reasons stated above this probably won't make it into the Core mod.

However, that is what the mod mods section is for, so don't feel bad about it.
 
The thought occurred to me the other day that we could use one of his compiled dlls for the core releases. But that brings up the debugging issue... and it seems we'd have problems with that sadly.
 
Only for Linux, not Windows.

Hm, I guess you could still compile the DLL in a virtual machine running Linux. That is if you actually can compile DLLs in the Linux version.

It's maybe worth a shot if turn times are being considered an issue.
For me with a larger map and later in the game it definitely is, and I'm running a pretty decent setup already.
 
Hm, I guess you could still compile the DLL in a virtual machine running Linux. That is if you actually can compile DLLs in the Linux version.

It's maybe worth a shot if turn times are being considered an issue.
For me with a larger map and later in the game it definitely is, and I'm running a pretty decent setup already.

No, because then it would be targetted to linux and not windows.
 
Top Bottom