Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site petrus.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!bellcore!petrus!hammond From: hammond@petrus.UUCP Newsgroups: net.lang.c Subject: Re: String Copy idiom Message-ID: <307@petrus.UUCP> Date: Wed, 13-Mar-85 07:25:55 EST Article-I.D.: petrus.307 Posted: Wed Mar 13 07:25:55 1985 Date-Received: Thu, 14-Mar-85 04:37:32 EST References: <1061@decwrl.UUCP> Organization: Bell Communications Research, Inc Lines: 36 > I think this is cute, how VAX/VMS beats Unix at its own game. The VMS C > compiler generates code as good as or better than anything I have seen posted > so far! > > ... I have also seen a benchmark program where the identical C program > was compiled and run on identical VAX hardware, one running Unix, and one > running VMS. The Unix program took 3 times as long to run as the VMS. This > program (which did all integer arithmetic) used static variables, so it didn't > even have the benefit of automatically placing auto's in registers when > possible. I would think Unix, being 95% written in C, would at least have a > d@mn good C compiler. Want to improve the throughput of your Unix system? > Recompile it in VAX/VMS C! > > These are not the views of Digital, although I am sure Digital agrees with me. > > Mike Moroney > ..!decwrl!rhea!jon!moroney Careful, things are not as simple as they seem. It turns out that while the early DEC VMS C compiler was better at compiling expressions and statements, it lost out to the UNIX C compiler in proceedure calls, since it followed the VMS standard (which either saves more registers or uses slower instructions, I'm not sure which). I expect that the newer VMS compilers would have the same problem, even if they were even better at optimizing code generation for expressions/statements. So, while your example program ran faster, troff/nroff runs slower if compiled with the early VMS C compiler (this info from Steve Johnson's course on PCC2 about 2 years ago). I am not sure what the net result would be if you recompiled all of UNIX with the VMS C compiler, but I wouldn't bet either way. Besides, if you were looking at the BSD C compiler, I am fairly certain that the newer compilers within BTL show improved performance. Rich Hammond {ihnp4 | decvax | ucbvax } !bellcore!hammond