简体   繁体   中英

Best C++ compiler and options for windows build, regarding application speed?

I am making a game for windows, mac and GNU, I can built it on windows already with MSVC and MingW...

But I am not finding good information regarding how much compilers optmize.

So what compiler, and options on that compiler, I can use to make my Windows version blazing fast?

Currently the profilers are showing some worring results like good portion of CPU time for example being wasted doing simple floating point math, and on the lua garbage collector.

EDIT: I am doing other stuff too... I am asking this question specifically about compilers, because the question is supposed to be one thing, and not several :)

Also, any minor speed improvement is good, specially with VSync turned on, a 1 frame per second drop at 60 FPS is sufficient to cause the game to run at 30 FPS to maintain sync.

First of all, don't expect compiler optimizations to make a huge difference. You can rarely expect more than a 15 or possibly 20% difference between compilers (as long as you don't try to compare one with all optimizations turn on to another with optimization completely disabled).

That said, the best (especially for FP math) tends to be Intel's. It's pretty much the standard that (at best) others attempt to match (and usually, truth be told, that attempt fails). Exact options to get optimal performance vary -- if there was one set that was consistently best, they probably wouldn't include the other possibilities.

I'd emphasize, however, that to get a really substantial difference, you're probably going to need to rewrite some code, not just recompile.

Having said that compilers can't help enough, you might want to consider fixed-point arithmetic. I have seen fixed point giving reasonable improvements on X86 and POWERPCs, over FP math. Fortunately, I could find a SO discussion on this topic.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM