1、 游戏是使用Visual Studio 2003 C++编译的 2 、编译采用了混合模式(blended mode),几乎没有任何优化。
在微软MSDN网站上,对混合模式是这样描述的:
When no /Gx option is specified, the compiler defaults to /GB, "blended"
optimization mode. In both the 2002 and 2003 releases of Visual C++ .NET, /GB is
equivalent to /G6, which is said to optimize code for the Intel Pentium Pro,
Pentium II, and Pentium III.
当不使用/Gx选项时,编译器缺省使用/GB 混合模式。在Visual C++
.NET 2002和2003中,/GB等价于/G6,为Pentium Pro、Pentium II和Pentium III优化。
微软推荐程序员为Pentium
4和Athlon系统编程时使用/G7。MSDN网站是如此描述的:
The performance improvement achieved by compiling an
application with /G7 varies, but when comparing to code generated by Visual C++
.NET 2002, it's not unusual to see 5-10 percent reduction in execution time for
typical programs, and even 10-15 percent for programs that contain a lot of
floating-point code. The range of improvement can vary greatly, and in some
cases users will see over 20 percent improvement when compiling with /G7 and
running on the latest generation processors. Using /G7 does not mean that the
compiler will produce code that only runs on the Intel Pentium 4 and AMD Athlon
processors. Code compiled with /G7 will continue to run on older generations of
these processors, although there might be some minor performance penalty. In
addition, we've observed some cases where compiling with /G7 produces code that
runs slower on the AMD Athlon.
编译中使用/G7选项带来的性能提高情况不同,但是相对于Visual C++ .NET
2002产生的代码,这个选项通常对于典型程序可以缩短5-10%的执行时间,对于含有大量浮点运算的代码,甚至可以缩短10-15%。使用/G7选项编译带来的性能提高幅度变化很大,在最新的处理器上运行,在某些情况下可能有超过20%的提升。
... it would be logical to at least compile the game code with /G6 and
/arch:SSE switches. That however, is not the case. I have checked it and the
code uses only FPU, which is known to work slower on Pentium 4s. Moreover it
uses pretty inefficient integer code too. Even /G6 would help a lot by enabling
the compiler to generate conditional moves instead of many conditional branches,
which are known to penalize NetBurst architecture so much.