Refactored sd_rperfo.

A bit nicer to look at, and less code.