Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 Feb 1997 11:46:52 -0800 (PST)
From:      Jake Hamby <hamby@aris.jpl.nasa.gov>
To:        hackers@freebsd.org
Subject:   Sun Workshop compiler vs. GCC?
Message-ID:  <Pine.GSO.3.95.970213110530.9550A-100000@aris>

next in thread | raw e-mail | index | archive | help
I just downloaded a 30-day trial of the newest version of Sun's C++
compiler (ProCompiler 4.2), which is supposed to offer much better
optimization than previous versions.  With the -fast option (which turns
on full optimization, plus 486, Pentium, or PPro optimization as
appropriate), it does seem to take about 3 times as long to compile
anything as GCC (on my 486DX4/100), and so I would hope that the generated
code is much better.

Can anyone come up with a good realistic test program for me to compare
Sun's compiler and GCC?  In order to make this topic even marginally
related to FreeBSD, I'd like to try comparing benchmarks between
Solaris/x86 with Sun's compiler, Solaris with GCC, and FreeBSD with GCC. 
Also, if anyone has any libm-intensive benchmarks, it should be
instructive to compare FreeBSD and Solaris's libm (since they both have a
common ancestor, the SunPro libm), since people have complained about
FreeBSD's libm (compared to Linux) in the past.  Unfortunately, I only
have a 486, and I expect the results would be quite different, and
probably even more in Sun's favor, with a Pentium (unless one used pgcc?).

I intend to build myself a Pentium soon, for various reasons it's now
obvious that my 486 is a dead-end and buying another PowerPC system (I
currently own a BeBox, which is now a collector's item since Be did a NeXT
and moved to a software-only company!) becomes less politically viable
(rumour has it that BeOS will be ported to Intel soon ;).  But by the time
I pay my taxes, and save up for my dream system, my Sun try-and-buy will
be expired, so I wanted to do as much testing of it as I can now.

In broader terms, it's good to see that Sun has put so much effort into
creating a highly optimizing x86 compiler, because previous versions had
very limited x86 optimizations.  It's also interesting to see that various
Pentium and PPro optimizations are supported, something we don't have in
the core GCC.  Of course Sun wants $995 for their compiler (or $3495 for
the whole workshop, which includes an IDE, debugger, Motif GUI builder,
etc.), so I'm only considering buying it because I'm expecting a massive
educational discount.  But my point is, if Sun (or anyone else) now offers
a significantly better compiler than GCC (which is what I'm trying to
prove or disprove), then it becomes *very* worthwhile (at least for
scientific/computational applications of FreeBSD) to import the SVR4
emulation from NetBSD (after the Lite/2 shakeout finishes of course). 

Will the Lite/2 changes make it easier to import the SVR4 module from
NetBSD, more difficult, or the same as before?

One final observation:  Isn't it scary that merely by recompiling their OS
with the new compiler, the next version of Solaris/x86 (2.6) should be
significantly faster than the previous version, making it an even bigger
threat to the free UNIX's for commercial users, and ESPECIALLY the
education market? While FreeBSD and Linux have an advantage by being
relatively small (and free, obviously :), even a bloated SVR4 like Solaris
can become "fast enough" just by throwing a lot of money into performance
tuning.  If they improve x86-specific support (adding Plug-and-Play,
PCMCIA, power management, etc., as rumored), and Sun's advertising
convinces corporate users that Solaris is superior for Internet and Java
uses (which might even be true in Solaris 2.6, if their TCP/IP performance
claims are true), and if you don't want to buy a Netra, maybe you'd buy
Solaris/x86 (if you have lots of money). 

As for education, while a lot of students get all excited about Linux, if
they discover that Solaris (about $200 educational) costs less than Linux
+ CDE + AcceleratedX + WABI, supports more Java tools, and ESPECIALLY if
they are using Suns or Solaris at school, it can only gain in popularity.
For that matter, SCO's going to release UnixWare for FREE in a few months
(for non-commercial use), so that makes SVR4 support even more useful.

In other words, and I'm sure Terry will agree :-), we need to cast our lot
in with either Linux or SVR4, in order to have a big enough market to
attract commercial apps.  Considering what I've said above, AND Linux's
continuing lack of a stable API for future growth without sacrificing
backwards compatibility (e.g. GNU libc), I'd be inclined to say SVR4... 

------------------------------------------------------------------------------
|Jake Hamby| APT Engineer at JPL, CS student at Cal Poly, and BeOS developer!|
------------------------------------------------------------------------------
"Life is hard..."




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.3.95.970213110530.9550A-100000>