Paul Harrell did a comparison between 9mm and .40 S&W in terms of terminal performance and concluded, after several tests, that the .40 was superior to the point where it could actually make the difference between stopping an attacker and failing to stop one. But that has to be balanced against the advantages of the 9mm, e.g., superior controllability and higher capacity.