[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Switch Case Loop Slower For Emulator
Bryan Parkoff <BParkoff@satx.rr.com> wrote:
: I have noticed that every programmers use Switch Case Loop for Emulator.
: Switch Case has to scan 256 opcode each time. I think that Switch Case Loop
: is very long for scanning. There has to be another way to reduce Switch
: Case Loop by removing too much case for scanning each opcodes.
: It has to use clever algorithm that will reduce Intel's cycle and
: improve performance.
Most C compilers can generate a jump table for a dense switch statement.
So the time on "scanning" the opcode and dispatch is constant.
If you have a C compiler handy, try compiling into assembly
(e.g. gcc -S) and looking at the compiler output.
-Doug
===============================================================
Remove XXX for my E-mail.