|
From: Jeremy H. <gcc...@gm...> - 2011-01-19 16:55:50
|
OK, Its a console text editor that supports a scripting language. The editor is about 11,250 lines of C and is self contained on Windows (doesn't use any extra libraries). Its been heavily optimized over many years. The "benchmark" is a (complex) regression test script reports the elapsed time at the end. It does a great deal of work including a lot of arithmetic and memory access, but very little disk access. I realise its too big an example for specific suggestions. I'll try and create a small example with simple compiler options for both compilers. I was really wondering if anyone else had seen this and if so what were their conclusions? FYI, the timings I had were (Windows XP SP3, on 1.6GHz Athlon XP, 1GB) : MinGW GCC 4.5.2 -Os 173 seconds MinGW GCC 4.5.2 -O3 105 seconds MS Visual C++ 2010 -O1s 89 seconds MS Visual C++ 2010 -O2t 87 seconds The same script on a 32 bit Linux box (GCC) runs a little faster (143 secs -Os), but still not as fast as VC++. The Linux 64 bit version on a 4GHz Core i7 executes in 20 seconds :-) The VS 2010 compile looks like this: D:\ge>cl -DFILE_TABS=4 -DSCREEN_TABS=2 /O1isyb2 /J /fp:fast /GFrS- /Qfast_transcendentals /arch:SSE /Zp4 /W2 g.c /Feg.exe /FAs Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.30319.01 for 80x86 The MinGW GCC (4.5.2) options are:- gcc -pipe -std=c99 -funsigned-char -DFILE_TABS=4 -DSCREEN_TABS=2 g.c -Os -Wall -Wextra -Wno-char-subscripts -ffast-math -mfpmath=387 -mpc80 -mhard-float -s -fno-ident -fshort-enums -fwhole-program -minline-all-stringops -fmerge-all-constants -fomit-frame-pointer -fno-non-call-exceptions -fno-asynchronous-unwind-tables -fno-exceptions -fno-unwind-tables -fira-loop-pressure -fstrict-aliasing -fstrict-overflow -march=athlon-xp -mtune=athlon-xp -o g Regards Jeremy |