How are you setting the pins?
digitalWrite() isn’t exactly the most efficient function (in fact, it takes something like 5-6 instructions for a SINGLE pin, if i remember correctly).
Writing to pin registers (DDRD, PORTD, DDRB, PORTB) is much much faster.
Edit: Argh, disregard, please. Apparently, i’m unable to read properly today