From the MIDIBOX description of the MIOS core:
The SRIO handler requires just only 75 uS to fetch the data from 128 digital input pins and to write out data to 128 digital output pins.
What this means is that he’s reading 128bits (from 16 74HC165 shift registers, all connected serially, IIRC) AND writing 128 Bits (into 16 74HC595 shift registers, all connected serially) all in these 75 µs. That’s a little less than 300 ns per bit. If I read the 165’s datasheet correctly, to safely read a bit out of it, you’ll need about 30 ns. What comes on top is data processing like reading the register, shifting the bits into place, and stuff like that. Plus some setup time after (or before) pulling the latches. This still sounds rather simple but I’d bet it is one heck of a heavily optimized piece of PIC assembler.
Plus it’s a nice little benchmark for my own plans: For reading rotary encoders without using an external interrupt, you’d have to make sure that you read often, and read fast, to be able to do it in an interrupt service routine. That is not an as easy task as I thought: My simple arduino sketch with an ISR written in simple C didn’t quite cut the butter, as it totally jammed the controller. as in “Wait, there’s an interr–Wait, there’s an interr–Wait, there’s an interr–”.
Which brings me to the next problem: I guess I need a real AVR programmer now, so that I can start some non-Arduino stuff. Boy, I am hardcore :)