From Jerry Coffin · 1996-04-12 09:32 · #73715 in EMULATE
On (09 Apr 96) Ed Beroset wrote to Chris Downs...
CD> Yes there are plenty of exceptions to the "not very often"
EB> criteria.
EB> I believe I've read that somewhere. I wonder if it's true?
Hmm...well, as originally stated, the rule was: the majority of non-I/O
bound programs spend roughly 80% of their time executing roughly 20% of
the code.
However, that only narrows the hot-spots to roughly 1 line out of 5,
still a fairly substantial amount of the code.
Second, it doesn't try to deal with I/O bound programs, which generally
have considerably different patterns.
Finally, I'd note that this was based on experience with general purpose
computers rather than embedded applications. With an embedded
application one can, and generally does, have a fairly specific idea of
the speed that's truly needed, and select the cheapest (aka slowest)
processor that can meet the needs. If you can write the code somewhat
more efficiently, you can sometimes use an even cheaper CPU. Depending
on volume, this can have a very definite effect on profit margins.
By contrast, when you're working with general purpose computers, the CPU
is generally pre-defined and its cost makes little or no difference to
the software. In addition, many (most?) general purpsose CPUs are quite
a bit faster than they really need to be anyway. Of course it's nice
when they pop things on the screen a bit faster and such, but when you
get down to it, probably 75% of the Pentiums in the world could be
replaced with, say, 486es without stopping the majority of programs run
on them from working just fine...
One other thing worth remembering (which I doubt I need to remind you
of) is the fact that in many cases, small size is as important as high
speed, especially if you need to stuff something into a ROM. In this
case, you can't easily profile the program and spend most of your time
in a few places - you usually have to look at the entire program, and if
anything often concentrate on the less used parts - there you can
comprimise speed in favor of saving space with little effect on overall
speed.
Later,
Jerry.
... The Universe is a figment of its own imagination.
--- PPoint 1.90
* Origin: Point Pointedly Pointless (1:128/77.3)