Actual shootings contain infinite variables, making any best handgun/caliber choice very subjective.
If I could be certain of multiple hits during a high-speed mag dumps, there are some very good ,22 mag cartridges and pistols that will swiss-cheese a violent opponent in seconds.
With the likelihood of everyone involved moving, scoring even one hit at close range, is repeatedly a dismal statistic.
Over the years I have become tired of reading/watching trained police officers relying on any high capacity pistol to do the job, with entire mag dumps and none or only a single minor hit.
During your cover, fire, and maneuver,
settle down and do your best to make the first shot count. If the only firearm you can handle decently is a .22, that is what you should use. My choice is the 1911 in .45 with 230 grain +P loads.
Statistically, mega-round counts are improbable and there is little data supporting incredibly fast, rapid fire as truly effective.
A spare reload is naturally common sense to carry, regardless of caliber.