c编译 - gcc vs visual c [英] c compilation - gcc vs visual c

查看:100
本文介绍了c编译 - gcc vs visual c的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好:


我最近在cygwin gcc

3.4.4和microsoft visual c下编译了一个数字密集的c项目。该平台是英特尔T2400 1.83 ghz

双核圈顶。


数值的东西是浮点和整数密集


gcc优化(-O3)与非优化改进了性能30%

visual c优化(标准,检查''发布;在visual c 2005下)

vs非优化(''build'')是一个惊人的8倍性能增益


但最令人惊讶的是视觉c优化为2x
$ b优于gcc的$ b性能。


是其他任何人看到同样的事情。如果这是真的那么微软c

编译器完全属于另一个联盟


到目前为止我还没有成功在mingw下进行编译。是否会产生凹痕?

2x难以克服

解决方案

ku ****** @ gmail.com 写道:


hello:


我最近在cygwin gcc

3.4.4和microsoft visual c下编译了一个数字密集的c项目。该平台是英特尔T2400 1.83 ghz

双核圈顶。


数值的东西是浮点和整数密集


gcc优化(-O3)与非优化改进了性能30%



越高优化越多,越慢

它去了。使用-O2。


visual c optimized(标准,检查''发布;在visual c 2005下)

vs non优化(''build'')是一个惊人的8倍性能增益



这是因为非优化版本注入了很多

检查代码,以避免错误。它比严格必要的慢。

例如,如果没有堆栈覆盖,他们会在功能出口检查。


但最令人惊讶的是视觉c优化了2x

性能优于gcc优化。



英特尔编译器甚至优于微软。它是intel架构的最佳编译器

。期间。


是其他人看到同样的事情。如果这是真的那么微软c

编译器完全属于不同的联盟



显然微软远远落后于gcc,我一直看到这个

至少8到9年。


i到目前为止在mingw下编译并不成功。是否会产生凹痕?

2x难以克服



mingw只是使用Microsoft运行时库的gcc。不要指望

更好/更差。


gcc比微软要慢,因为

落后人每个项目都有着截然不同的目标和实现它们的
预算。


Gcc在许多平台和架构中运行。

Microsoft仅在一个平台上运行。


Gcc实现C99(模块小问题)等标准,Microsoft

仅实现Microsoft环境(.net等)。微软仍然是C89级别的



-

jacob navia

雅各布雅各布point remcomp point fr

logiciels / informatique
http://www.cs.virginia.edu/~lcc-win32


jacob navia写道:


Microsoft仅在一个平台上运行。



对不起,但这是不真实的。我所知道的平台是IA32,英特尔和AMD的64美元平台,MIPS,ARM,SH等等。请注意,后者

用于MS的嵌入式平台。


Uli




kumar ... @ gmail.com写道:


你好:


我最近在cygwin gcc

3.4.4和microsoft visual c下编译了一个数字密集的c项目。该平台是英特尔T2400 1.83 ghz

双核圈顶。


数值的东西是浮点和整数密集


gcc优化(-O3)与非优化改善了性能30%



这可能不会对你有所帮助,但作为一个观点我有兴趣

有时候发现-Os

用gcc更好地工作(优化尺寸)。


Stijn


hello:

I recently compiled a numerically intensive c project under cygwin gcc
3.4.4 and microsoft visual c. The platform is intel T2400 1.83 ghz
dual core lap top.

the numerical stuff is both floating point and integer intensive

The gcc optimized (-O3) vs non optimized improved the performance 30 %

visual c optimized (standard , check ''release; under visual c 2005)
vs non optimized (''build'') was a whopping 8x performance gain

but the most surprising thing was visual c optimized was 2x
performance over gcc optimized.

is anybody else seeing the same thing. if this is true microsoft c
compiler is in a different league altogether

i was not successful so far compiling under mingw. will it make dent ?
2x is hard to overcome

解决方案

ku******@gmail.com wrote:

hello:

I recently compiled a numerically intensive c project under cygwin gcc
3.4.4 and microsoft visual c. The platform is intel T2400 1.83 ghz
dual core lap top.

the numerical stuff is both floating point and integer intensive

The gcc optimized (-O3) vs non optimized improved the performance 30 %

The more you go with higher optimizations, the slower
it goes. Use -O2.

visual c optimized (standard , check ''release; under visual c 2005)
vs non optimized (''build'') was a whopping 8x performance gain

This is because the non optimized version injects a lot of
checking code to avoid bugs. It is slower than strictly necessary.
For instance they check at function exit if there wasn''t a stack overwrite.

but the most surprising thing was visual c optimized was 2x
performance over gcc optimized.

Intel compiler is even better than Microsoft. It is the best compiler
for the intel architecture. Period.

is anybody else seeing the same thing. if this is true microsoft c
compiler is in a different league altogether

Obviously Microsoft leaves gcc far behind, and I have been seeing this
since at least 8-9 years.

i was not successful so far compiling under mingw. will it make dent ?
2x is hard to overcome


mingw is just gcc using Microsoft run time library. Do not expect
anything better/worst.

It is not surprising that gcc is slower than Microsoft since the
people behind each project have vastly different objectives and
budgets to implement them.

Gcc is running in many platforms and architectures.
Microsoft is running in one platform exclusively.

Gcc implements standards like C99 (module small problems), Microsoft
implements only Microsoft environments (.net, etc). Microsoft is
still at C89 level.

--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32


jacob navia wrote:

Microsoft is running in one platform exclusively.

Sorry, but that''s untrue. The platforms I know are IA32, Intel''s and AMD''s
64 bit platforms, MIPS, ARM, SH and maybe some more. Note that the latter
are used for MS'' embedded platform.

Uli



kumar...@gmail.com wrote:

hello:

I recently compiled a numerically intensive c project under cygwin gcc
3.4.4 and microsoft visual c. The platform is intel T2400 1.83 ghz
dual core lap top.

the numerical stuff is both floating point and integer intensive

The gcc optimized (-O3) vs non optimized improved the performance 30 %

It''s probably not going to help you, but as a point of interest I have
sometimes found -Os
to work better (optimize for size) with gcc.

Stijn


这篇关于c编译 - gcc vs visual c的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆