Você está na página 1de 12

PROGRAMMER’S TOOLCHEST

Comparing C/C++
Compilers
It’s all about flexibility, portability, efficiency, and performance
Matthew Wilson

D
espite the advent of new programming languages and tech- 1. C1. A large (1000 functions) monolithic (no include files) C-
nologies, C++ is the workhorse for many developers, and file (compilation only; no optimizations).
is likely to remain so for a long time to come. The main 2. C2. A C file with a large number (500) of include files (com-
reasons for C++’s prominence are its flexibility, portabili- pilation only; no optimizations).
ty, efficiency, and performance. Yes, even with the increase in 3. C3. A C file with a large number (100) of nested include files,
processing power, software performance continues to be im- each of which is included by its prior file, and then by the
portant, and C++ is a language that — when used correctly— main file, thereby testing the effects of multiple inclusions
provides superior performance in virtually any context. and include guards (compilation only; no optimizations).
In this article, I compare nine popular C++ compilers in terms 4. pch. A suite of C++ files (main.cpp, pch.cpp, and 40 .h/.cpp
of performance, features, and tools. The compilers are either ex- class files) sharing common header(s), facilitating precom-
clusively Win32 or provide Win32 variants. I conducted all stud- piled headers (compile and link; precompiled headers; no
ies on a Windows XP Pro machine (single-processor, 2 GHz, 512 optimizations).
MB) with no other busy processes. The compilers I examine are: 5. whereis. A single complex C++ file with several template
and operating-system library includes (compilation only; op-
• Borland C/C++ 5.6 (C++ Builder 6). http://www.borland timized for space). This tool provides powerful command-
.com/products/downloads/download_cbuilder.html line searching and is included as a sample in the STLSoft li-
• Digital Mars C/C++ 8.34. http://www.digitalmars.com/ braries, exercising much STLSoft code.
• GNU C/C++ 3.2 (The MinGW 2.0 distribution). http://www 6. MMComBsc. A large (44 C and 37 C++ source files, 111 head-
.gnu.org/software/gcc/ er files, 80 KB in production) DLL providing COM functions
• Intel C/C++ 7.0. http://intel.com/ and classes (compile and link; precompiled headers; opti-
• Metrowerks CodeWarrior 8.3. http://store.metrowerks.com/ mized for space).
• Microsoft Visual C++ 6.0. http://shop.microsoft.com/devtools/ 7. zlib. A free, general-purpose, data-compression library portable
• Microsoft Visual C++.NET 2002 (VC++ 7.0). across hardware and operating-system platforms.
• Microsoft Visual C++.NET 2003 (VC++ 7.1).
• Watcom C/C++ 12.0 (Open Watcom C/C++ 1.0). http:// I used Python scripts (available electronically; see “Resource
openwatcom.org/ Center,” page 5) to generate the source files for scenarios 1– 4. The
source files are very large and not included with this article. The
As for bias, I confess to having soft spots for DigitalMars, In- whereis source is available at http://stlsoft.org/. (You can get the
tel, and CodeWarrior, all of which have helped me in creating most up-to-date binary from my company’s web site, http://
the STLSoft libraries (http://stlsoft.org/). Nevertheless, my day- synesis.com.au/r_systools.html.) The source files for MMComBsc.dll
to-day tool of choice is not one of these. contain too many proprietary goodies for me to include here, so
you’ll have to take my word for the figures reported.
Compilation Time I used ptime (http://synesis.com.au/r_systools.html) to get the
In many situations, compilation time is not important. However, it results from scenarios 1–3 and 5 by executing multiple (15) times,
is crucial on large systems or in development situations with fre- discarding the two-highest and one-lowest results, and report-
quent builds (such as Extreme Programming). When compiling/link- ing an average of the rest. This reduces distortion from caching
ing source, important factors include the number of inclusions, or startup. I executed scenarios 4, 6, and 7 using makefiles, tim-
use of precompiled headers, complexity of code, aggressiveness ing the process via ptime. Table 1 presents the results.
of optimization (in both compilation and linking), and size of trans- The “Did Not Compile” (DNC) notation for CodeWarrior in
lation units. For this article, I considered these scenarios: scenario C3 results from the compiler refusing to process the
nested include depth of 100; tests showed that 30 was the lim-
Matthew is a consultant for Synesis Software, as well as au- it. CodeWarrior help says, “To fix this error, study the logic be-
thor of the STLSoft libraries and the upcoming Imperfect C++ hind your nested #includes. There’s probably a way of dividing
(Addison-Wesley, 2004). He can be contacted at matthew@synesis the large nested #includes into a series of smaller nests”— which
.com.au or http://stlsoft.org/. is probably true, but may not always be so. Watcom could not

16 Dr. Dobb’s Journal, October 2003 http://www.ddj.com


(continued from page 16) rameterized a value type of stlsoft::basic_simple_string<char>
compile the whereis and MMComBsc scenarios because it doesn’t instead of std::ba- sic_string<> to promote effects of compil-
support templates sufficiently. er efficiency and reduce differences in their respective stan-
There are some significant differences — up to two orders of dard library implementations. The scenario creates a variable-
magnitude in some cases — between performances. Borland sized 3D array, (100×100×100) and iterates through all three
comes off best, closely followed by VC++ 6, with Digital Mars parameter ranges, assigning a deterministic pseudorandom val-
and VC++ 7 about an equal third. CodeWarrior, GCC, and Intel ue to each element. Two approaches are performed.
are the sluggards of the group. (Naturally, it’s not possible to cre-
ate a single objective comparison criterion, even if you have an • The first approach conducts this enumeration once.
exhaustive set of scenarios. The way I’ve done it is to do three • The second approach does it 10 times. Thus, the cost of al-
rankings. First, positions 1– 9 are summed — lowest value wins. locating and initializing the 1 million members is amortized
Second, the first four positions are awarded 10, 7, 5, and 3 (and thus diluted) in the second variant, focusing instead
points — highest value wins. Third, the first three positions are on the costs involved with the array (template) element ac-
awarded 5, 3, and 1 points — lowest value wins. Only when these cess methods.
rankings are in accord do I talk of “best,” “second,” and so on.)
VC++ and Watcom are streets ahead when precompilation is 5. zlib. This is a library featured in many applications (http://
appropriate — that is, when most or all of the source is C++. VC++ zlib.org/). It seemed a valuable, and uncontrived, performance
7 compiled the pch scenario 43 times faster than CodeWarrior! test. The test program memory maps a given file, memory maps
Also, VC++ 7.1 is slower than VC++ 7.0 in every test. a corresponding output file, and then, within a timed loop, com-
presses the entire contents of the source file. I compiled both
Speed of Generated Code zlib 1.1.4 source and the test program with the nine compilers,
Next, I looked at the speed of generated code, restricting my- and executed it on both large (65 MB) and small (149 KB) files.
self to these five scenarios:
Other than the Dhrystone scenario (the implementation I
1. Dhrystone. This benchmark (http://www.webopedia.com/ used has its own internal measurement mechanism), all sce-
TERM/D/Dhrystone.html) tests integer performance. Since it narios derive their timing behavior from WinSTL’s perfor-
is CPU bound (that is, there is no I/O or resource allocation mance_counter class (see http://winstl.org/ and my article
within the timed sections), it is a good test of pure com- “Win32 Performance Measurement Options,” Windows De-
piled code speed. The performance is measured as number- veloper Network, May 2003; http://www.windevnet.com/
of-Dhrystones per second (a bigger number is better). documents/win0305a/), which times the appropriate internal
2. Int2string. Converting integers to string form can be a costly loop. Each has a warmup loop so that the results reflect pure
business. Ten million integers (0=>9,999,999) are converted to code performance, rather than being influenced by operating
string form, and their string lengths summed (to prevent over- system or other effects. All scenarios were optimized for speed
optimization). The two approaches I used employ different (-O2, -opt speed, -o+speed, -O3, -O2, -O2, -O2, -ot). Table
mechanisms for conversions: 2 presents the results.
Except for the Dhrystone scenario, I executed within a cus-
• The compiler library’s sprintf( ). This performance reflects tom test harness that ran them nine times, discarded the high-
the difference in the efficiency of the compilers’ libraries. est and lowest times, and averaged the remainder. The source
(Intel uses VC++ 7.0 libraries.). code for all scenarios is available electronically.
• STLSoft’s integer_to_string<> template function (see my arti- The “DNC” for Digital Mars is because Digital Mars is not sup-
cle “Efficient Integer To String Conversions,” C/C++ Users Jour- ported in Boost 1.30, which I was using. Boost/Digital Mars
nal, December 2002). This inline template derives the string compatibility is underway, and may be complete as you read
form empirically, so performance directly reflects the com- this article. The multiple DNC entries for Watcom reflect its gen-
piled code’s performance. eral lack of template support.
Intel is streets ahead of the rest, being fastest in two scenar-
3. StringTok. This generates a large set of strings to tokenize, ios and second in five. (Indeed, its only poor performance is in
using “;” as the delimiter. It tokenizes the string, then iterates the Int2String(sprintf) scenario, in which its performance is heav-
over the sequence totaling the token lengths. (It avoids over- ily dependent on VC++ 7.0 run-time library’s sprintf( )). Second
optimization by the compiler, but maintains consistency of test come Digital Mars, VC++ 7.0, and VC++ 7.1, all about even. Con-
data between compilers by pseudorandomizing based on the sidering that Digital Mars has the Boost no-show, it’s a cred-
Win32 GetVersion( ) function, which returns the same value for itable overall performance.
all programs because they’re run on one test system.) I used By virtue of its no-show in five scenarios, and very poor per-
the boost::tokenizer<> (http://boost.org/) and stlsoft::string_to- formance in two others, Watcom takes the wooden spoon. How-
keniser<> (http://stlsoft.org/) tokenizer libraries. ever, it wins the Int2String(sprintf( )) scenario, so things aren’t all
4. RectArr. To really hammer the ability of compilers to gener- bad. Borland and CodeWarrior do well in a few—Borland is quick-
ate efficient code in complex template scenarios, I used STL- est in zlib (large)— but let down in other areas. GCC performs
Soft’s fixed_array_3d<> 3D rectangular array template. I pa- badly all around, except for the two STLSoft variants.
Scenario Borland CodeWarrior Digital Mars GCC Intel VC++ 6 VC++ 7 VC++ 7.1 Watcom

C1 60 685 308 1368 4095 214 229 243 2781


C2 314 1680 412 886 1994 261 587 1640 687
C3 62 DNC 65 182 305 75 137 336 129
pch 21,203 113,328 16,921 39,234 16,578 3812 2656 3343 4625
whereis 937 3441 2243 3261 3004 1098 1401 1523 DNC
MMComBsc 35,250 158,078 29,828 DNC 80,593 39,390 41,921 45,250 DNC
zlib 1187 5859 1828 4890 4593 1984 2250 2703 1250

Table 1: Compilation times (in ms) of the seven scenarios for the range of compilers. (Figures in bold are best results.)

18 Dr. Dobb’s Journal, October 2003 http://www.ddj.com


It’s worth noting the differences between the variants of the In any event, you always prefer smaller code. In Table 3, which
Int2String and StringTok scenarios. Using STLSoft’s inte- focuses on module size, VC++ wins hands down. VC++ 7.0 pro-
ger_to_string<> template provides significant performance ad- duces the smallest code, followed by VC++ 7.1, and then VC++
vantages, with execution times being between 15 and 55 per- 6.0. Intel, Digital Mars, and Watcom acquit themselves reasonably
cent of those of sprintf( ). The string tokenizers exhibit well, taking one scenario each. Borland and CodeWarrior don’t
considerable differences: The execution time of STLSoft’s tok- do too badly, except where it really matters in the one sizable,
enizer is between 6 and 26 percent of Boost’s. real-world project. The jaw-dropping miscreant is GCC, with mod-
ules up to 10 times the size of the leader in some scenarios.
Size of Generated Code
Execution speed is not always more important than size, nor Language Support
do speed optimizations always provide faster executing pro- Compiler support for language features is also important. Since
cesses, since larger code is more likely to undergo cache miss- there are a huge number of features that are (not) supported
es and require consequent virtual memory activity by the op- by modern C++ compilers, I focus on those I know of and am
erating system. (I always optimize for size, and only for speed interested in; see Table 4.
based on the results of testing. I’m in good company. In De- Having wchar_t as a built-in keyword is not that important,
bugging Applications for .NET and Windows, John Robbins since it can be easily, portably, and robustly synthesized via the
reports that Microsoft optimizes for size on all operating sys- preprocessor— usually with a typedef from unsigned short;. How-
tem components.) ever, this does reduce overloadability. The _ _ func_ _ predefined
Scenario Borland CodeWarrior Digital Mars GCC Intel VC++ 6 VC++ 7 VC++ 7.1 Watcom

Dhrystones/s
Dhrystone 1,847,675 1,605,696 2,993,718 2,496,510 2,606,319 2,490,718 2,263,404 2,450,608 484,132

time (ms)
Int2string a (sprintf()) 7642 5704 5808 7714 7933 9419 7802 7813 5539
Int2string b (STLSoft) 3140 1289 3207 1679 1156 1624 1808 1843 DNC
StringTok a (Boost) 4746 3272 DNC 6809 1450 2705 2641 2341 DNC
StringTok b (STLSoft) 636 809 280 385 382 579 383 406 DNC
RectArr (1 iteration) 1082 910 997 1590 859 915 824 887 DNC
RectArr (10 iterations) 6922 3168 5589 3853 1649 1995 1533 1828 DNC
zlib (small) 92 110 88 92 87 87 91 78 90
zlib (large) 8412 12,550 8847 11,310 9390 10,875 10,266 9117 15,984

Table 2: Execution times (in ms) of the nine scenarios for the range of compilers. (Figures in bold are best results.)

http://www.ddj.com Dr. Dobb’s Journal, October 2003 19


identifier is nice for debugging infrastructure, but again, there
are workarounds.
The importance of floating-point precision is not as easily dis-
missed (see “How Java’s Floating-Point Hurts Everybody Every-
where,” William Kahan and Darcy, http://http.cs.berkeley
.edu/~wkahan/JAVAhurt.pdf). Only Borland, Digital Mars, GCC,
and Intel (with option -Qlong _double) provide long-doubles
that match the Intel architecture’s 80-bit capabilities. For serious
numerists, this will be important.
Static assertions are also important, since they facilitate
checking of invariants at compile time, rather than run time.
They are based on the illegality of zero or negative array di-
mensions (int ar[0];, for example) and are usually wrapped
up in a macro such as:
#define stlsoft_static_assert(_x)
do { typedef int ai[(_x) ? 1 : 0]; } while(0)

The Digital Mars is the only compiler that does not support
them, although it will do so from Version 8.35 onwards. Note
that neither Borland 5.5(1) or 5.6 are able to optimize them out
of code, leading to performance costs.
Variable-length arrays (VLAs) and dynamic application of the
sizeof operator are C99 features. Only Digital Mars and GCC
support them. Except for VC++ 6, all compilers support covari-
ant return types.
Koenig lookup is a useful mechanism (see my article “Gen-
eralized String Manipulation: Access Shims and Type Tunnel-
ing,” C/C++ Users Journal, August 2003), whereby operations
associated with an element from one namespace may be auto-
matically accessed from another without namespace qualifica-
tion. VC++ (6 and 7), Watcom, and, except with nondefault pa-
rameter, Intel, do not support this.
The for-scoping rules were changed in C++.98 (ISO/IEC C++
Standard, 1998), and all compilers except VC++ 6 and Wat-
com support the new syntax. Interestingly, Intel gives a warn-
ing when used correctly, but in a way that would fail to com-
pile under the old rule. (In my opinion, you should never
write code that relies on either old or new rules, so this should
not occur in production code. This warning is useful to avoid
doing so.)
All the remaining issues involve templates. Though it does
have some template support, Watcom fails on all remaining tests.
VC++ 6 and 7 fail on the important facility of partial specializa-
tion, although Version 7.1 provides full support.
One VC++ 6 weirdness is that it won’t accept the typename
qualifier within the default parameters of a template, something
other compilers (GCC and CodeWarrior, for example) mandate.
You must resort to the preprocessor to support them all. (Con-
formance masochists can check out the definition of ss_type-
name_type_def_k in the STLSoft headers.)
Except for Digital Mars, VC++ 6.0, and Watcom, all compil-
ers support template templates. This technique isn’t currently
widely used, but is useful and will be more so in the future. Fu-
ture compilers need to support it.
Overall, GCC is the clear winner. Since I think static asser-
tions, 80-bit floating-point, and Koenig lookup are more im-
portant than VLAs and _ _ func_ _, I would put Borland sec-
ond, CodeWarrior and VC++ 7.1 third, Digital Mars fourth, and
Intel fifth. I would rate all of these as good compilers. Next
come the other VC++s and Watcom. Once the next version of
Digital Mars is released, it will likely have a perfect score, too.
However, you can expect likewise from other vendors soon,
since language conformance has become a marketable fea-
ture once more.
One feature not included in Table 4 involves typedef templates
(see “The New C++: Typedef Templates,” by Herb Sutter, C/C++
Users Journal, December 2002), which none of the compilers

20 Dr. Dobb’s Journal, October 2003 http://www.ddj.com


Maximize Your Application Performance
Intel® C++ and Fortran Compilers 7.1
for Windows* and Linux*
Intel’s expertise in processors really shows in this latest
release of their high-performance C++ and Fortran compilers.
Intel compilers provide access to the latest advanced
processor technologies. Give your application a performance
boost with little or no source code modifications!

15%
Faster Integer Performance
Performance!
1084 Outstanding performance on Intel architecture including Intel®
1000
939 Pentium® 4, Intel® Xeon™ and Intel Itanium® 2 processors,
800
as well as support for Hyper-Threading Technology.

600
Compatibility
400
Windows
200 • Plugs into Microsoft Visual Studio* (6.0 and .NET*)
0 • Native source and binary compatibility with MS Visual C++*
Leading C++ Intel C++
for Windows Compiler 7.0 • Strong compatibility with Compaq Visual Fortran*
SPECint_base 2000† Linux

Intel® Pentium 4 Processor, 3.05 GHz, 512 KB • Source/binary compatibility with GNU C, and extensive
L2 Cache, 256MB Memory, Windows XP
Professional MP Kernel, Build 2600 source/binary compatibility with gcc 3.2 for C++.

31%
Faster Integer
Support
Performance! 1034
1000
Purchase includes 1 year of free product upgrades and
789
Intel Premier Support
800

600 “We recently switched to the Intel C++ Compiler from a leading compiler for
400 use on Maya 5.0’s dynamics code. The output ran so much faster—up to 90%
faster—than before, that our engineer didn’t actually believe it and rechecked
200
his data. To say the least, we are impressed with the Intel product.”
0
GCC 3.2 Intel C++ —Kevin Tureski
Compiler 7.0 General Manager of Maya Engineering
SPECint_base 2000†† Alias|Wavefront
††
Intel® Pentium 4 Processor, 3.05 GHz, 512 KB
L2 Cache, 256MB Memory, Red Hat* Linux* 8.0

YOU SAVE UP TO $159! Paradise # Retail Discount


Intel® C++ Compiler 7.1 for Windows I23 0A10 399.00
$ $
308.99
®
Intel C++ Compiler 7.1 for Linux I23 0A12 399.
$ 00 $
308.99
Intel® Fortran Compiler 7.1 for Windows I23 0A11 499.00
$ $
385.99
To order or request additional
®
Intel Fortran Compiler 7.1 for Linux I23 0A13 699.00
$ $
539.99
information call:
FREE 30-day trials available at: 800-423-9990
Email: intel@programmers.com
programmersparadise.com/intel/ddj
© 2003 Intel Corporation Intel, the Intel logo, Pentium, Itanium, Intel Xeon and VTune are trademarks or registered trademarks of Intel
Corporation or its subsidiaries in the United States and other countries. *Other names and brands may be claimed as the property of others. 03CT010B
(continued from page 20) Win32/Platform SDK. All the Win32 compilers support the
support. VC++ 7.1 does report that “error C2823: a typedef tem- Win32 API (including many Microsoft language extensions,
plate is illegal,” which suggests Microsoft intends on supporting such as _ _declspec( )), although some do not support the ver-
it soon, possibly in Version 7.2. sion that comes with the Platform SDK (various constructs —
including inline assembler — are not recognized). Specifically,
Features GCC and Watcom do not support the February 2003 version of
The Standard Library. Except for Digital Mars and Watcom, the Platform SDK.
all compilers support the C++.98 Standard Library without ma- 16-bit. Both Digital Mars and Watcom support 16-bit targets.
jor problems. Digital Mars C++ comes with both SGI’s STL and Demand for this is low; but if you need it, it’s good to be able to
the latest STLport (http://www.stlport.org/), but has yet to up- get it somewhere.
date to the new header names (<iostreams> rather than WTL. I recently did some work to get various compilers
<iostreams.h>) and to have things declared within the std name- (including VC++ 5!) to work with WTL, but have not reached
space. Both compilers are working toward full conformance. a definitive conclusion as to support. What I can say is that
ATL. As far as I know, all compilers other than GCC and Wat- VC++ and Intel work with it out- of-the-box, CodeWarrior
com support ATL, although I suspect that some only support with a little work, and Borland and Digital Mars with a fair
Version 3, not 7. I’m not aware of any language-support issues bit of effort.
preventing GCC from supporting ATL, but I haven’t tested this. I’d like to mention one thing I’m fond of— the Digital Mars -wc
I am certain that Watcom could not support ATL, because of its flag— which warns about all C-style casts within C++ compila-
current template deficiencies. tion units. This is great when sifting through code to find areas
Boost. Boost is a library suite supported by all the compilers that need “modernizing.” (Also, the author of the Digital Mars
except Digital Mars (where support is coming), Visual C++ 6 (which compiler added this feature on my request, and did so within
has limitations), and Watcom (which is not supported at all). an amazingly short turnaround.) It would be nice to see this in
Managed C++. Only VC++ 7.x supports Managed C++. In the other compilers.
context of this article, however, Managed C++ isn’t a bona fide
feature because Managed C++ is not C++, any more than C is C++. Tools
MFC. Despite showing its age, MFC is a widely used (and occa- Most of the compilers come with Integrated Development and
sionally useful) framework. It is fully supported by Visual C++, In- Debugging Environments (IDDEs). Since editor/IDDE pref-
tel C++, CodeWarrior, and Digital Mars. I also understand it is avail- erences are nearly as religious as those for bracing style, I
able with Borland C++ Builder, though I have not used it with that couldn’t hope to do a balanced job — even if I knew all the
compiler. To my knowledge, neither Watcom nor GCC support MFC. salient features of each environment. While I have some ex-
STLSoft. Except for Watcom, all compilers support most of perience with all the IDDEs, and can say that they all pro-
the STLSoft libraries, and even Watcom supports a sizable part vide the minimum functionality required to create/edit pro-
(where the templates are within its capabilities). STLSoft is bun- jects and source and debug executables, some are (to be
dled with Digital Mars 8.34 upwards. candid) pretty basic. The Digital Mars and Watcom IDDEs
Scenario Borland CodeWarrior Digital Mars GCC Intel VC++ 6 VC++ 7 VC++ 7.1 Watcom

Dhrystone 60,416 57,344 53,788 98,118 49,152 45,056 45,056 45,056 47,616
Int2string a (sprintf()) 56,320 57,344 40,476 95,282 40,960 40,960 36,864 40,960 33,792
Int2string b (STLSoft) 56,320 57,344 40,476 95,953 40,960 40,960 36,384 40,960 DNC
StringTok a (Boost) 78,336 69,632 DNC 458,004 65,536 57,344 49,152 53,248 DNC
StringTok b (STLSoft) 68,096 65,536 43,036 453,945 53,248 53,248 45,056 49,152 DNC
RectArr 64,512 65,536 43,548 100,343 31,744 45,056 40,960 45,056 DNC
zlib (small) 75,776 86,016 83,484 151,916 65,536 61,440 53,248 57,344 81,408
MMComBsc 214,528 245,760 138,780 DNC 98,304 90,112 102,400 102,400 DNC
Table 3: Size of modules (in bytes) of the eight scenarios for the range of compilers. (Figures in bold are best results.)
Feature Borland CodeWarrior Digital Mars GCC Intel VC++ 6 VC++ 7 VC++ 7.1 Watcom

wchar_t keyword No No Option* Option* No


__ func__ predefined identifier No No No No No No
80-bit long doubles No Option* No No No No
static (compile-time) assert Not optimized** No
static array size determination No No
Variable Length Arrays No No No No No No No
dynamic sizeof No No No No No No No
Covariant return types No
Koenig lookup Option* No No No
new for scoping rules No Option* Option* No
typename (template arg) No
typename (qualifier) No
typename (qualifier in template No No
default parameter)
member template fns No
member template ctors No
member template classes No
template partial specialization No No No
template templates No No No
Table 4: C/C++ language features supported by the range of compilers. (* Available via a nondefault compiler option;
** Not optimized out in release builds.)

22 Dr. Dobb’s Journal, October 2003 http://www.ddj.com


GUARANTEED BEST PRICES*
® Should you see one of these products listed at a lower price in another ad in this magazine,
CALL US! We’ll beat the price, and still offer our same quality service and support!
*Terms of the offer:
• Offer good through Oct. 31, 2003 • Offer does not apply towards
Your best source for software • Applicable to pricing on current
versions of software listed
obvious errors in competitors’ ads
• Subject to same terms
development tools! • Oct. issue prices only and conditions

Prices subject to change. Not responsible for typographical errors.

XMLSPY 2004 NEW! RoboHelp Office


by Altova The Industry Standard in Help Authoring Paradise Picks
XMLSPY 2004 is the industry standard XML Create professional Help systems for desktop
Development Environment for designing, editing and Web-based applications, including .NET.
and debugging enterprise-class applications. • Create all popular Help formats
Now including: • Create standard and advanced
Enterprise Edition • Visual Studio® .NET Integration Help-specific features
Paradise # • XML-to-XML Mapping • Work in WYSIWYG or true code
I0D 017T • XML Differencing Programmer’s Paradise #1 • Easily create context-sensitive Help
$ Best-Selling Help Authoring
965.99 XMLSPY 2004 is the ultimate productivity Tool for 7 Years Running! • Generate printed documentation DevTrack 5.5
Professional Edition enhancer for J2EE, .NET and database developers. Paradise #
• Winner of 55 industry awards Powerful Defect and
Paradise # * Price after mfr’s mail-in rebate. New Project Tracking
E75 0311
I0D 017U US/Can licenses only. Expires 10/31/03.
$ by TechExcel
$
389.99 www.programmersparadise.com/altova 859.99* www.programmersparadise.com/ehelp DevTrack, the market-leading defect
and project tracking solution, compre-
LEADTOOLS Intel C++ and Fortran Compilers
®
hensively manages and automates
Document Imaging by Intel your software development processes.
by LEAD Technologies Version DevTrack 5.5 features sophisticated
Increase the Performance 7.0
Document imaging including annotations, workflow and process automation,
of Your Application with seamless source code control integration
specialized bitonal (b/w) image display Intel’s High-Performance Compilers with VSS, Perforce and ClearCase,
and processing like scale-to-gray and Intel’s expertise in processors shows in this latest release robust searching, and built-in reports
favor-black, performance and memory of its flagship compiler product-line: Version 7 of its and analysis. Intuitive administration
optimizations for bitonal images, image C++ and Fortran Compilers for Windows and Linux. Intel C++ and integration reduces the cost of
clean-up like hole-punch, line and staple Intel Compilers deliver outstanding performance on for Windows deployment and maintenance.
Pentium® 4 and Intel® Xeon® processors, and the Paradise #
removal, high-speed scanning.
64-bit Itanium and Itanium 2 processors and take I23 0A10
Paradise # advantage of Multi-processor systems and programmersparadise.com/techexcel
$
L05 048V Hyper-Threading technology. 308.99 Paradise #
$
$
1,639.99 www.programmersparadise.com/lead www.programmersparadise.com/intel
T34 0199 482.99
c-tree Plus® TX Text Control ActiveX 10.0
by FairCom by The Imaging Source NEW
With unparalleled performance and sophistication, Add RTF, DOC, HTML, CSS and
.NET
c-tree Plus gives developers absolute control over VERSION!
their data management needs. Commercial PDF Support to Your Application
developers use c-tree Plus for a wide variety of TX Text Control is royalty-free, robust and powerful
embedded, vertical market, and enterprise-wide word processing software in reusable component form.
database applications. Use any one or a combina- The new Enterprise/XML version features a rich set of properties for the
NEW! tion of our flexible APIs including low-level and manipulation of XML and CSS. Developers can now offer end-users the
SQL ISAM C APIs, simplified C and C++ database ability to separate their textual content from their formatting rules.
Support! APIs, SQL, ODBC, or JDBC. c-tree Plus can be used
to develop single-user and multi-user non-server Download a demo today. Enterprise Edition Professional Edition Sun™ ONE Studio 5,
Paradise # Paradise # Paradise #
F01 0131
applications or client-side application for FairCom’s
T79 0214 T79 0215 Standard Edition
robust database server—the c-tree Server. Windows
to Mac to Unix all in one package. $
1,495.99 $
729.99 by Sun Microsystems
$
850.99 www.programmersparadise.com/faircom www.programmersparadise.com/theimagingsource Sun ONE Studio 5, Standard Edition
is an integrated development environment
PR-Tracker™ v5.1 (IDE) for Java technology. Based on the
SourceOffSite Classic
modular, open source NetBeans Tools
by SourceGear Corp. New by Softwise Company
Version! Platform, this IDE is ideal for building
Access SourceSafe™ Affordable scalable enterprise level bug and deploying Web services across
3.5.3
over the Internet tracking system featuring classification, multiple hardware and software platforms,
Visual SourceSafe collaboration tool assignment, sorting, searching, reporting, including Windows, Windows NT, Linux,
for distributed teams. access control, user permissions, attachments and the Solaris Operating Environment.
and email notification. Integrates with
• IDE integration PR-Tracker Web Client (included) and
• Over 10 times faster than RAS ProblemReport.asp (included for your
• Efficient—uses data compression betatest or customer support interface).
• Secure—up to 128-bit data encryption Supports Access and SQL Server. Paradise #
Paradise #
• Familiar—the look and feel of VSS S0Z 041C Download Today! S3R 0147
• Cross-Platform—Windows and UNIX. www.programmersparadise.com/sunone
$
† Classic edition plus Media, 1 user.
$
223.99† 117.99 Paradise #
$
556.99
www.programmersparadise.com/sourcegear www.programmersparadise.com/softwise S69 0U67

800-445-7899 • programmersparadise.com
(continued from page 22) about fourth on execution size.) For now, it is let down by
aren’t going to pry many programmers from their favorite en- nonstandard Standard Library support, the occasional ICE, and
vironments. an outdated IDDE— but it’s free and you get such good ser-
Perhaps anachronistically, my editor of choice is the Visual vice from its developer that these things are forgivable.
Studio 97 IDDE, which I use because I know the keystrokes, can • GCC has the best language support, which is commensurate
write some useful wizards/plug-ins/macros, and it’s quick, doesn’t with its having the widest collaboration of any open-source
require the use of the mouse, can debug, and doesn’t crash. I (and probably commercial as well) compiler in the business.
have experience with the IDDEs of C++ Builder, Digital Mars, However, this may also account for its poor efficiency char-
CodeWarrior, and Visual Studio 98, and .NET, and they either acteristics. On my tested scenarios, it proved to be the slow-
have too many or too few features, crash, or make me take my est compiler, and produced the slowest and fattest code. (This
hands off the keyboard. Nonetheless, I know people who swear can be contrasted with Digital Mars, which is written and main-
by them, so it’s a case of to each his own. tained by one person.)
• For speed of generated code — which is often the most im-
Conclusion portant factor — Intel reigns supreme. It does well on the
Clearly, you cannot simply say compiler X is superior to all oth- size of generated code, although it is let down somewhat by
ers. Most compilers are superior to others in one or more respects. compilation speed. It scores well on language issues, al-
though getting it to listen to warning-suppression commands
• Borland is the fastest compiler, has good language support, is sometimes a trial. It does not have any kind of IDDE, but
and doesn’t shame itself in any other regard. Though it’s not plugs into Visual Studio (98 and .NET) without problems,
one of my compilers of choice, it has value to contribute in other than that precompiled headers and browse informa-
its good warnings. However, it seems to share VC++’s predilec- tion go to pot. I’m always surprised when I speak with clients
tion for internal compiler errors (ICEs) when things get too who are writing performance-sensitive software in a Microsoft
hard for it, which I find annoying. environment (Win32 systems, Visual Studio) and yet have
• For me, CodeWarrior is the last word in language rules, con- not considered using the Intel compiler. It’s definitely an es-
formance, and error-message readability— and it is invoked sential part of a programmer’s armory.
whenever another compiler balks at something I’ve written • Visual C++ does better than I expected. It produces the small-
that I think should be okay. Moreover, it has a good (though est code, is quick to compile, and does well in the perfor-
not great) IDDE, produces reasonably efficient code, and has mance of generated code (though it’s still way off Intel’s per-
support for all the popular libraries. It would be the compil- formance). It also, finally, has good language support; VC++
er I’d chose if I could only have one. 7.1 even discovered some typename qualification errors in the
• Digital Mars comes off very well, featuring in the top three for STLSoft libraries that CodeWarrior and GCC missed. And, in
language support, compile time, and execution speed. (It’s my opinion, it has the best IDDE by a country mile. It is/has
been badly let down by poor language support (now im-
pressively, though belatedly, addressed in Version 7.1), long
update cycles (it was five years between Versions 6 and 7),
ridiculous gigabyte install sizes, and by assumptions in the
compiler and the IDDE that you will be using Microsoft ex-
tensions, MFC, and so on. Furthermore, there are too many
ICEs for my liking (even one should be an embarrassment),
which makes you question how much testing goes into it. Fi-
nally, WTL should be a fully supported part of Visual Stu-
dio.NET, wizards and all.
• Watcom is poor on template support, which made it hard to
give it a fair comparison with all the other compilers. It did
well in the areas in which it featured, although Dhrystone per-
formance was extremely poor. I hope it will continue to de-
velop in its Open Watcom guise, and return to the glories that
were Watcom C/C++ in the mid ’90s.

All C++ professionals and organizations should use more than


one C++ compiler at all times. No compiler provides all the pos-
sible useful warnings, so compiling with multiple compilers af-
fords much more comprehensive coverage. Furthermore, there’s
nothing better for making your code port-prepared than making
it work with more than one compiler. Particularly bad in this re-
gard have been the Borland and Visual C++ compilers. Many
times, I’ve built substantial projects that have worked well in one
of these compilers, only to find in porting that I’ve done non-
standard things, and even had bugs. So, I would recommend that
all C++ developers modify your work environments to incorpo-
rate three or four compilers; you’ll find your code quality rises
sharply. Given that many of these compilers are free — Borland
5.5(1), Digital Mars, GCC, Intel (for Linux), Watcom — it seems
remiss to do otherwise.

DDJ

24 Dr. Dobb’s Journal, October 2003 http://www.ddj.com


The .NET resource Dr. Dobb’s
you’ve been waiting for! XML
Resource
Get your copy now! CD-ROM
NEW!
Dr. Dobb’s Journal’s
XML Resource CD-ROM
The beauty of XML is its promise of easy data exchange
among disparate platforms and its ability to let you define
a document's content separately from its formatting.
Because of this, XML is revolutionizing both the type of
applications being developed and how programmers
develop those applications.

Dr. Dobb's XML Resource CD-ROM, developed by former


DDJ executive editor and Web Techniques editor-in-chief
Michael Floyd, provides you with all of the information
and tools you need to become a power XML
programmer right away!

This rich and unique CD-ROM includes the full text of


• Delivered in PDF format. Michael’s best-selling books Building Web Sites with XML
and Special Edition Using XSLT, along with his popular
• Packed with C++ code examples. Web Techniques columns ”Beyond HTML“ and ”XML@
• Thousands of lines of source code. Large“. In addition, the CD-ROM includes Michael’s
Rocket XML Framework (including full source code and
• A complete reference to the documentation), an XML tools database, a
.NET Framework comprehensive list of XML resources, and more!

Available via download for just Don’t get left behind.


$
19.95
or A $59.54 value for only $39.95.
on CD-ROM for only
$
24.95
Available Online at Available Online at www.ddj.com
www.ddj.com/dotnetbook/ Dr. Dobb’s XML Resource CD-ROM is available
by phone at 1-800-444-4881 (US); 1-785-841-1631
(International); or by fax at 1-785-841-2624.
ESSENTIAL INFORMATION
FOR SERIOUS DEVELOPERS
DDJ’s Developer Solutions Resource
Dr. Dobb’s would like to make your life and job easier…so, we’ve created
a section within DDJ.COM to allow you to quickly and easily research
development tools and services!

Detailed
product

{
information
at your
Product fingertips
categories for
fast searches

Company
information

and more!

Don’t spend valuable hours or days


searching for the perfect solution…visit
Developer Solutions Resource today and find
what you’re looking for quickly and easily!

VISIT TODAY! www.ddj.com/product/


On the Web at www.ddj.com

The ULTIMATE Career Resource for


the Professional Developer
Whether you’re looking for a hi-tech job or you’re an employer seeking
qualified candidates, Dr. Dobb’s Journal’s Software Developer Careers is
for you!

Job seekers can search through job listings, find career advice on resume
writing, interviewing and negotiations … employers can search for skilled and
qualified candidates and post current job openings … ALL ON ONE SITE!

VISIT TODAY!

www.developercareers.com

Você também pode gostar