What matters in a self defense gun/caliber/bullet is multiple, rapid, and accurate placement of bullets which expand sufficiently in size and penetrate to sufficient depth at it's expanded size.
Energy is something you don't really need to give much thought to. Because of how well modern defense ammo is designed today, the best 9mm, .40 cal, and .45 acp bullets all expand to relatively similar diameters and the best all penetrate to relatively similar depths. 124 gr. +P 9mm ammo tends to yield expansion and penetration very close to that produced by .40 cal and .45 acp JHP defense ammo.
A 9mm projectile expanding to .63" to .71" and penetrating to 12" is generally in the same "terminal ballistic" ballpark as a .40 or a .45 acp projectile which expands to .66" to .71" and penetrates 11". Don't worry about velocity or energy... but rather concern yourself with rapid and accurate placement of bullets giving you deep penetration and good expansion. All the energy and velocity in the world won't do you any good if you can't VERY RAPIDLY and VERY REPEATEDLY place a number of premium-design defense bullets RIGHT where they need to go. This tends to be a little easier for most people to do with 9mm, as the recoil is milder and return to target is quicker! Especially when shooting one-handed, if need be. AND, 9mm offers much greater capacity before reload than .45, and somewhat greater capacity before reload than .40. There is a LOT to support the choice of 9mm in a defense weapon.... if the best ammo is used (124 gr. +P JHP).
Some folks fervently chase after high velocity, believing that is the "key" to stopping power; while others chase after great energy, believing that is the "key" to stopping power.... when what they should really be concerned with is achieving a good 12" of penetration and expansion of about .6 to .7" from a caliber and weapon that is compact, easy to shoot very rapidly and accurately, easy to control, and having high capacity.
When it's all said and done, the 9mm performs this combination of objectives quite magnificently - when using the right ammo and the right platform. It can easily be argued that in the hands of a skilled defensive shooter, a Glock 19 loaded with 16 rounds of 124 gr. +P Gold Dots is every bit as effective and even better from a *tactical* standpoint than a 1911 loaded with 9 rounds of 230 gr. Gold Dots. I feel well armed with either and often rely on my Glock 19 with 16-rounds of 124 gr. +P Gold Dots, my Glock 23 with 14-rounds of 180 gr. Gold Dots, and occasionally on a 1911 Colt Commander loaded with 9-rounds of 230 gr. Gold Dots. ALL of these will do the job comparably well if the shooter is skilled, prepared, and knows his gun/ammo system well. That given, I'm happier with MORE rounds on tap before a reload, rather than fewer rounds on tap before a reload, hence my G23 and G19 see more carry duty than my beloved 1911's do.