1

I'm a long time Borland users ( since Turbo C ) ( until BC5.2 ). I've been using MingW/GCC with CodeBlocks for about a year now, mainly for the extra support esp. native 64bit integers.

Anyway, I have a query regarding compilation speeds.

I have a C (Win32) file which is apx 60,000 lines in length. On Borland 5.2 this file takes apx 3-5 seconds to compile. On GCC it takes a bit over 35 seconds.

The GCC command line options I am using are.

-std=c99 -s -O2 (ive also tried -O)

The final exe size is pretty much the same +/- 50kB.

Why the big difference in compilation time ? and is there a way to speed up GCC to be comparable to BC5.2 ?

4

1 回答 1

3

Borland 的编译器从一开始就被设计为快速,至少根据当时发布的营销和基准测试,并且在业界得到广泛认可。它们针对单一架构,即 x86 系列。

gcc不是为了快速而设计的。它旨在:

  • 多种架构的目标代码,从嵌入式控制器到超级计算机
  • 托管在多个架构上
  • 跟上不断变化的 C++ 语言标准

预期用途的分歧无疑会影响其性能。

于 2011-09-28T05:28:47.927 回答