Re: count2.asm
- From: randyhyde@xxxxxxxxxxxxx
- Date: 27 Jul 2005 12:40:59 -0700
¬a\/b wrote:
>
> Is it possible that one can do some C code that assembly people can
> not do faster? (>0.1%) (i think yes, because i have seen that code)
Can not do faster? Absolutely. But they always be able to do it *as
fast* by simply copying what the compiler does.
Note that once code is optimal (meaning as good as it can get), you
aren't going to get any better. Sometimes, by design or by accident,
compilers do generate optimal code for a given sequence of
instructions. Indeed, in my experience (studying compiler output),
compilers have a habit of producing some *brilliant* code, that
generally beats what an assembly language programmer would write when
hand coding the same stuff. The only problem is that in other sequences
in the program, compilers tend to output brain-dead code that even a
beginning assembly programmer can beat. The combination of the two
still comes out pretty good, but an expert assembly programmer can copy
what the compiler does well and rewrite the stuff the compiler does
poorly, and wind up with slightly better code.
Of course, the *real* way to get better performance (or size) is to
think like the machine rather than thinking in abstract, high-level,
terms. An assembly programmer who acts as a "human compiler" for a C
code sequence isn't going to do much better than a C compiler, if they
do better at all. The real improvement comes when you think the problem
through at the machine level rather than in C and write your code
accordingly.
Also, on a smaller application, such as the character frequency app
being discussed here, there is less room for massive improvement
because the program is so small.
Cheers,
Randy Hyde
.
- References:
- count2.asm
- From: Frank Kotler
- Re: count2.asm
- From: ¬a\\/b
- Re: count2.asm
- From: Frank Kotler
- Re: count2.asm
- From: ¬a\\/b
- count2.asm
- Prev by Date: Re: statistic
- Next by Date: Re: HAY Betov, still no support for GPL or LINUX, WHY ????
- Previous by thread: Re: count2.asm
- Next by thread: Re: count2.asm
- Index(es):
Relevant Pages
|