msvc的有时候比g++的还慢很多
d:\>g++ p30m2.cpp -O2
d:\>cl p30m2.cpp -O2
用于 x86 的 Microsoft (R) C/C++ 优化编译器 17.00.51106.1 版版权所有(C) Microsoft Corporation。保留所有权利。
p30m2.cpp
Microsoft (R) Incremental Linker Version 11.00.51106.1
Copyright (C) Microsoft Corporation. All rights reserved.
/out:p30m2.exe
p30m2.obj
d:\>timer a
Timer 9.01 : Igor Pavlov : Public domain : 2009-05-31
Start
146511208
472335975
534494836
912985153
[2066327172]
Kernel Time = 0.031 = 0%
User Time = 6.801 = 72%
Process Time = 6.832 = 73%
Global Time = 9.334 = 100%
d:\>timer p30m2
Timer 9.01 : Igor Pavlov : Public domain : 2009-05-31
Start
146511208
472335975
534494836
912985153
[2066327172]
Kernel Time = 0.015 = 0%
User Time = 6.754 = 73%
Process Time = 6.770 = 73%
Global Time = 9.165 = 100%
d:\>g++ p14a1.cpp -O2
d:\>cl p14a1.cpp -O2
用于 x86 的 Microsoft (R) C/C++ 优化编译器 17.00.51106.1 版版权所有(C) Microsoft Corporation。保留所有权利。
p14a1.cpp
Microsoft (R) Incremental Linker Version 11.00.51106.1
Copyright (C) Microsoft Corporation. All rights reserved.
/out:p14a1.exe
p14a1.obj
d:\>timer a
Timer 9.01 : Igor Pavlov : Public domain : 2009-05-31
maxstep=950 ,at 63728127
Kernel Time = 0.234 = 3%
User Time = 3.822 = 56%
Process Time = 4.056 = 59%
Global Time = 6.789 = 100%
d:\>timer p14a1
Timer 9.01 : Igor Pavlov : Public domain : 2009-05-31
maxstep=950 ,at 63728127
Kernel Time = 0.312 = 2%
User Time = 11.466 = 81%
Process Time = 11.778 = 83%
Global Time = 14.150 = 100%
lt 发表于 2016-11-27 21:07:49