Quite often, users report the JPEG filesize as a measure of lens quality in terms of sharpness. The rationale behind that is that if the image is sharper, it has more details, and thus the compressed image is larger. The question that I am trying to answer here is: does this make sense? Is that really so?
Actually, one could imagine that depending on the scene, the amount of details can increase or decrease the image size. Obviously a black square on white background will be compressed to a smaller size than the same square with gaussian filters applied, because the latter will now have many more grey levels that need to be saved.
The reason for this little investigation is the doubt that reporting file size is a valid method of testing lens quality. This is also the majority opinion in some Usenet groups. On the other hand, if this method worked, then it would constitute a rapid and simple way of comparing the lenses in a real setup and without using artificial targets.

Fig 1. Amount of artificial blur influences the resulting file size. Top: a real image fragment. Bottom: a black square on white background.
Artificial tests. First, I wanted to know whether indeed, sharpness corresponds to file size in an artificial setup. I took a fragment of a reasonably sharp photograph (here) and applied consecutive gaussian blurs of radius 2 in GIMP, saving the results in a JPEG at 85% compression level. The results (see below) show that indeed, the file size depends significantly on the sharpness.
However, I have prepared also another theoretical example, a black square on white background and applied the same filter series. The file size increased, showing that image sharpness does not always positively correlate with file size.
Using a camera with different lenses. I have photographed the same scene using several lenses (50-58mm and two zooms at 50mm) and several apertures for each lens. The scene chosen was not involving any BW target normally used for testing lens resolution; the previous experiment has shown that data obtained from schematic BW drawings is different from data derived from normal photographs. The camera used was a 6Mp DSLR at 100 ISO, and the image files were JPEGs produced at the highest quality available for that camera. Camera was mounted on a stative. RAW files were not used because usually the "tests" report JPEGs as produced by the camera (as opposed to JPEGs created from RAW files on a computer).
Next, the file size was measured, and the values were plotted. Please note that differences between lenses cannot be taken directly from this plot: the lenses had different focal lengths, so that the images and their sizes obviously are not directly comparable.
Fig 2.
Comparison of different file sizes for different appertures and different lenses. Each line color corresponds to different lens. Each data point is an aperture value and image size for a given lens. Do not use this graph to compare lenses (see text for explanations).
Expected is the increase of detail with smaller apertures (because DoF increases). Indeed, the smaller the aperture, the larger the file. However, this trend is clear only for large apertures; at the other end of the scale, the curves even tend to drop again (no statistical significance inferred).
Lens comparison. To test whether a comparison between the lenses can be made at all using such a set up, I have cut out corresponding fragments and resized them to account for different resolutions depending on the focal length.
Fig 3. Correction for focal length: file size of a cropped and scaled down image depending on lens and aperture.
The differences between lenses of different focal length disappear. What
remains is the difference between the zooms (an inferior Canon 35-80mm zoom
and an obsolete Exacta M42 zoom) and the fixed focus lens. These
differences correspond to the common opinion about these lenses, however
they do not allow any fine comparison. However, since lighting conditions
were not controlled, not much can be concluded from this primitive setup.
In general I find that JPEG file size does, indeed, correspond to the sharpness of an image. This is shown both by an experiment with artificial blurring of an image and by increasing file size with decreasing aperture. However, there are several points which make such comparisons at best hard to convey.
Firstly, it can be demonstrated that whether file increases or decreases depends on the particular target that is photographed.
Secondly, this type of comparison works well only for large differences in sharpness. In the experiment, once the DoF increased so as to span over the whole depth of the scene, the differences were too small to be really significant.
However, following considerations could help designing a test based on file size: