a style question

Jim Giles jlg at lanl.gov
Sat Oct 6 07:20:30 AEST 1990


>From article <MEISSNER.90Oct5151114 at osf.osf.org>, by meissner at osf.org (Michael Meissner):
> In article <537 at mtndew.Tustin.CA.US> friedl at mtndew.Tustin.CA.US (Steve
> Friedl) writes:
> [...]
| | This is seductive but true only superficially.
| |
| | Q: Given two equally-talented teams of programmers, one using C and
| |    one using assembler, which team will produce the system with best
| |    execution time for a non-trivial program?
| |
| | A: The team writing in C.  While the assembler folks are busy optimizing
| |    that inner loop, the C people are testing three different algorithms
| |    to see which one is *really* faster.
|
| Or even:
|
| A: The team writing in C has already produced two or three revisions,
|    changing the code so that it gives the customer what s/he wants,
|    instead of what s/he asked for.
|
| Also a possibility:
|
| A: The team writing in C, since the team writing in C has switched to
|    a new hardware platform that is not upwards compatible with the
|    previous platform, but it twice as fast....

But the answer generally found by experience is that the assembly is
faster.  The C language is so full of pitfalls that it usually takes
as long to get a working version of _any_ algorithm written in C as it
does to write it in assembly.

There is a popular word processor which was originally written in
assembly.  They decided to invest a lot of money to produce a C version
(to which end, they hired a lot of C 'gurus' so as not to be handicapped
by lack of experience with the language).  They confidently predicted the
C version would be ready before the next release of the assembly version
and would be nearly as fast.  The C version actually took longer to write
than the next _two_ major assembly version upgrades.  The C version is
considerably slower as well (like doing a global search and having to wait
10 seconds instead of instant response - the kind of thing that wastes
considerable time for anyone unfortunate enough to be forced to use it).
It is true that the C version has been ported to other machines - but what
is the good of that?  All they have is a slow word processor on more than
one platform - it doesn't compete well with the native products on any
machine.  Meanwhile, their assembly version still sells well.  As far as I
can tell, this is a typical experience.

J. Giles



More information about the Comp.lang.c mailing list