String Copy idiom

Ozan Yigit oz at yetti.UUCP
Fri Mar 15 05:24:09 AEST 1985


> 
> 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)...
	The procedure calls are perhaps slower in VMS C compiler,
	due to saving all the registers that VMS C compiler so
	greedily uses. One should remember, however,
	that if the programmer were to hand-specify as many registers
	as he possibly can, to improve his/her program, this would result
	in an identical procedure call on, say C compiler of 4.2., which
	would be just as slow or fast, however you look at it.
> 
> 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.

	True, I would not bet on it either. But, aside from greedy
	register algorithm in VMS C, If the BSD C compiler was as smart
	as VMS C in optimization and architecture utilization, you would
	have a *MUCH* faster 4.2 !!


	Oz	(wizard of something or another, no doubt)
	Dept. of Computer Science
	York University
	{utzoo | utcs}!yetti!oz



More information about the Comp.lang.c mailing list