Boost logo

Boost :

From: Gary Powell (Gary.Powell_at_[hidden])
Date: 2000-09-26 13:39:28

> Not for x86-family machines they shouldn't. For the 386
> and above, byte arithmetic and load/stores are as fast
> as "int" sized ones. It would be unfair to force everyone
> to use four times as much space when there is no speedup.
> Considering how common the x86 is, it would be nice to
> get this one right.
> I have a suspicion that 16-bit operations carry no penalty
> on Pentium II and higher, although these certainly took
> a hit on earlier Intel processors. (I think AMD chips were
> better in this regard. I don't know about Cyrix.)
Test test and profile some more!
On some of the early Pentiums (Intel P90's, P100's 586), a char (byte)
arithmetic was 4x that of an int, and a short (16 bit) 2x. Did we change all
the data to 32 bits? No, just that of some inner loops.

Remember the optimization motto:
Get it working,
Get it right,
Make it small,
Make it fast.

And Test Test Test! (Profile before and after changing.) I keep having to
relearn this. I put in an unrolled duff's device and it made the loop 8x
slower because the code no longer fit in the on the cache. I added
"register" to some loop variables and gcc 9.25 got faster, KAI got slower!
(register, he must mean he really wants one even though I don't need one.)


Boost list run by bdawes at, gregod at, cpdaniel at, john at