Hi !

> Handling the KGI commands, most drivers use a switch () {case ...}
> structure. This looks nice, but results in very slow code (each case
> results in at least one conditional jump, which can slow down the CPU
> badly)

Than your compiler is bad. It should employ a binary search pattern or a 
calculated jump table.
If the M$ compiler the last program I disassembled used can do it, I am
very sure GCC/EGCS will do it as well.

> I was wondering: Using a procedure lookup table would improve the speed a
> lot, 

Not really. Look at the other stuff that gets executed before. I doubt this 
will be noticeable.

Just test it: Run a test program with the switch in place, and one with the
"right" call hardcoded. I doubt the difference can be measured.

CU, ANdy

-- 
Andreas Beck              |  Email :  <[EMAIL PROTECTED]>

Reply via email to