Date: Wed, 11 Jan 1995 15:48:24 +0100 From: gbm AT ii DOT pw DOT edu DOT pl (Grzegorz B. Mazur) To: djgpp AT sun DOT soe DOT clarkson DOT edu Subject: deadly optimization I am really impressed with optimization discussion on the list. I would like to point out that on 486 and Pentium simple ADD (or adding two registers to form the address) is not ANY slower than simple move. You can't get any nanosecond by substituting say mov al, [table + edx] with "mov dl, x; mov al, [edx]", and the code using such trick is quite risky (non-portable, non-debuggable, etc.). The code generated by gcc with -O2 or -O3 is quite good. I am imressed with the improvements of current version over gcc 2.3.x. Some time ago I switched from WATCOM (8.5 / 9.0) to djgpp with gcc 2.3, keeping WATCOM for time-critical apps. With 2.6.x there is no visible difference in speed between gcc and Watcom, which I think is the best optimizing compiler widely available for 386+. With such a beast any code handcrafting is a waste of time. Note how much time you spend writing inline code, and count how much time it can save during execution... Then I also hope we will not be stuck with CrazyGlue to x86 CPUs for the rest of our lives, so investing the precious time to study the architecture of the ies going to its decline is not very useful. Gregory.