From mboxrd@z Thu Jan 1 00:00:00 1970 To: 9fans@cse.psu.edu From: "Thomas Bushnell, BSG" Message-ID: <87d6yta5dj.fsf@becket.becket.net> Content-Type: text/plain; charset=us-ascii References: Subject: Re: [9fans] GUI toolkit for Plan 9 Date: Mon, 25 Feb 2002 17:10:50 +0000 Topicbox-Message-UUID: 559b7300-eaca-11e9-9e20-41e7f4b1d025 rob@plan9.bell-labs.com (rob pike) writes: > > I thought he meant the way it vastly outperformed puny little toy > > compilers like the one in Plan 9. > > I've heard this before. People talk about GCC as though it's fast and > generates particularly efficient code. I've never heard anyone claim that GCC is particularly fast; that's not a design goal. > Neither of these appears to be true, at least as of a couple of > years ago. I was teaching a course and, requiring ANSI C, made the > students use the commercial SUN C compiler instead of GCC. (GCC > isn't strict or accurate about ANSI no matter how many flags you > turn on.) I heard a lot of complaints from the students that GCC > was better so we did a shootout. The SUN compiler ran several times > faster and the code it produced ran about 10%-40% faster on a > variety of benchmarks. This, of course, was on the SPARC. Many years ago, GCC was better (that is, produced more efficient code) than all available commercial compilers but two; one was the Sun Sparc compiler, and the other was the MIPS compiler. The MIPS compiler was doing inter-function optimizations that GCC is not yet really capable of. The Sparc compiler, it happens, had special magic detectors for certain standard benchmarks, and if you were compiling one of those, it would spit out pre-made assembly code (it was obvious; the *formatting* of the code indicated it was not being produced by the normal codegen of the compiler). If you tweak the benchmarks slightly, the Sparc compiler was no longer very much better, though it still beat by a couple percent. I believe the MIPS compiler is still superior, but not the Sun Sparc compiler. > Much longer ago, we did a similar shootout with Plan 9's compiler > against GCC on the MIPS, with similar results, but I hear GCC has > improved somewhat on that architecture. Of course, my comment was about toy compilers like the Plan 9 one. Saying "GCC isn't as good as the Sparc compiler" doesn't mean that the Plan 9 compiler is anything but a cute toy. > I just did a sloppy compile-time test of Plan 9's 8c against GCC on a > 386 and see that 8c runs dramatically faster. I don't dispute that > GCC could be generating better code, however; I didn't test that and > 8c isn't particularly good. For me, though, compile time matters more > than quality of code, as long as the code is reasonable. Really? Having an optimizing compiler would make *everything* on the system run faster. I would bet you that "Running 8c on an unoptimized system" is *slower* than "Running GCC without -O on an optimized system". Thomas