String Copy idiom

hammond at petrus.UUCP hammond at petrus.UUCP
Wed Mar 13 22:25:55 AEST 1985


> 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 at 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



More information about the Comp.lang.c mailing list