Microcontroller I/O & ADC Benchmarks

I had noticed the Mega seemed slower at digital I/O but never bothered to investigate as it was analogue I was interested in. Maybe it's due to core differences in how pins are read/written as pin 9 is PWM on both UNO & MEGA and don't seem to serve as multi function pins (I2C, SPI, UART etc.) that may slow things down. The only other possibility I can think of is interrupt overheads as I don't disable them for testing but analogue read is the same between both UNO & Mega.

Ideally the test sketch should do all the I/O pins and maybe include analogWrite() on supported pins but it served the purpose I needed. Maybe I or someone else can do comprehensive tests at some point.