Changing the code to run faster - direct port manipulation HELP!

There is no problem in speed stepper motor, rpm motor set with "delayMicroseconds(600);"
The problem is the encoder. If you quickly turn encoder motor turns slowly.
If the encoder slowly turning turns faster and more accurately.
If I measure the signal with an oscilloscope has the correct encoder pulses in both fast and slow turn.
I agree with MarkT. Motor direction and motor pulse signal output are too fast. And driver card is not keeping pace with the signal.
What about now.