The sensor size comes into play when you enlarge the image to fit a predetermined final display image size.
That\'s why someone shooting in large format can use f-stops as small as f/45 and f/64 and still produce 16x20 images of superior sharpness to anything coming from 24x36mm...even given the greater diffraction and inferior sensor plain flatness of the larger format.
Diffraction at f/22 that matter when the original image is enlarged 16 times and viewed at one meter doesn\'t matter when the original image is enlarged only four times and viewed at the same distance.