Re: Memory mapped IO vs Port IO

Jesse Barnes
2003-09-12T17:48:52Z

Ok, Andi asked for benchmarks, so I ran some. Let this should be a
lesson on why you shouldn't use port I/O :) I ran these on an SGI Altix
w/900 MHz McKinley processors.

Just straight calls to the routines (all of these are based on the
average of 100 iterations):
writeq(val, reg) time: 64 cycles
outl(val, reg) time: 2126 cycles

A simple branch:
if (use_mmio)
writeq(val, reg) time: 132 cycles
else
outl(val, reg) time: 1990 cycles

Using a wrapper to point to one of the routines:
wrapper->write(val, reg) time: 215 cycles
wrapper->out(val, reg) time: 3931 cycles

Thanks,
Jesse