Raw speed is just one consideration. In this case, I suspect that there is C language Unix device driver for the Raspberry Pi and that the XS module is the "glue" between that driver and Perl. The PIO driver will probably have to do some low-level stuff that is not well-suited to Perl and perhaps not even possible, like perhaps writing to a specific hardware address. So XS as an interface layer to the C language device driver is completely plausible to me.