Comparing basic coding
Stack movement speeds
   PUSH, POP and direct read
   PUSHFD and POPFD
These tests use the api QueryPerformanceCounter to test the speed of the processor in performing each instruction 500 times. These is achieved as follows. Prior to performing each test, Testbug creates an area of execute/write/read memory using the api VirtualAlloc. Testbug then writes the opcodes for the instruction into the memory area so created . This is written 500 times so that there are 500 instructions to be executed. Having made a note of the time, execution of the processor is then transferred to the beginning of the area of memory containing these instructions. The 500 instructions are therefore carried out. At the end of the 500 instructions the time is tested and displayed. Testbug then frees the memory which was used and moves on to the next test.
PUSH, POP and direct read
The actual instructions which are tested here were chosen to give some idea of the speed with which the processor can shift data in the stack. Usually this is very fast and much faster than transferring data to and from other parts of memory. The first test, INC EDX is used as an index so you can see how quick the processor is when using the stack, compared with this very fast instruction.
PUSHFD and POPFD
This time you can see how quick the processor is when pushing and popping the flags.