First post, by swaaye
I've spent a few hours compiling DOSBOX. I have a EeePC 900 and wanted to see if I get get a bit more speed out of the little 900MHz Celeron M inside it. I've only compiled DOSBOX one other time, years ago, so I needed to relearn how to do it. The wiki and some forum threads here were invaluable. I am a PHP programmer / Linux admin by day so I have some decent experience with using GCC on a Linux-based server and was at home once things were up and running.
I got DOSBOX CVS from the Wiki, DOSBOX 0.72 source from the main site, MINGW 5.1.4, MSYS 1.0.10, and MsysDTK-1.0.1. Also got nasm.exe and the directx headers as instructed on the SDL Win32 guide. Compiled my own SDL with the DDRAW fix. Didn't mess with SDL_Net or SDL_Sound.
To figure out CFLAGS/CXXFLAGS, I usually go to the "safe cflags" list in the Gentoo Wiki. I went with "-march=pentium-m -O2 -pipe -fomit-frame-pointer". I also tested with -O3 and -Os. I tried out the --enable-core-inline DOSBOX option too. And, after reading about it in a thread here, I tried out GCC profile guided optimization. Compiled SDL without profile optimization, but with the above flags.
Profile optimization seems like it would add some significant variability to the compilation results. Depending on what games you use, how long you run them, what you do in the games, what parts of DOSBOX you use, etc.
References:
http://gentoo-wiki.com/Safe_Cflags
http://gcc.gnu.org/onlinedocs/gcc-3.4.6/gcc/i … _002d64-Options
http://gcc.gnu.org/onlinedocs/gcc-3.4.6/gcc/O … ptimize-Options
http://www.libsdl.org/extras/win32/mingw32/README.txt
CVS compile question(s)
http://www.dosbox.com/wiki/BuildingDOSBox
To test the results, I ran Chris Dial's CBENCH DOS SVGA 3D benchmark and QUAKE TIMEDEMO DEMO2 (in default VGA mode). Both programs showed the same relative performance boost or loss. I realize that there are a whole load of variables to DOSBOX performance, and picking a benchmark is going to be troublesome.
The results:
- -O2 is best. -O3 and -Os were slower. (CVS)
- profile guided optimization can give some definite benefits. The fastest compile I produced was a profile optimized DOSBOX 0.72 with "-march=pentium-m -O2 -pipe -fomit-frame-pointer". I used Crusader: No Regret, Quake, and Dark Forces as games to profile with. Ran the latter in FM music mode. (CVS,0.72)
- Profile guided optimizations produce a smaller executable. Resulting compile with "-march=pentium-m -O2 -pipe -fomit-frame-pointer" and profile optimization with 0.72 was 2.75MB. (CVS,0.72)
- -O3 caused compilation to fail in the "use profile" recompile. (CVS)
- DOSBOX's inlined memory cpu core option was not faster. (CVS)
- The current CVS is somewhat slower than 0.72. Same profile guided compile with above options ~30% slower (14.5 vs. 19.5fps) in Quake timedemo. However, performance was equal in CBENCH SVGA. I couldn't make a CVS compile run as fast as 0.72 no matter the flags.
Results in Quake vs. 0.72 stock exe were a ~5% improvement. This is going to vary though. Tested in full screen with fullresolution=0x0, dynamic core, cycles=max, frameskip=0, output=ddraw, scaler=none, aspect=false.
If you'd like to download the executable from my fastest result and check it out:
http://rapidshare.com/files/137358177/DOSBOX_P-M.7z.html (~800KB)