The 45 ACP did the job for the military for what 75 years? I think it is an excellent fight stopper. The 40 S&W was developed for Police work because of some of the reported short comings of the 9MM. Ammo development has helped level the playing field.
There are generally two schools of thought on caliber: big and slow or small and fast. Basically a large caliber heavier bullet moving at a slower speed like the 45 ACP. It makes a large hole and penetrates deeply. The second is a smaller caliber lighter bullet traveling at a higher rate of speed. At impact the bullet is supposed to expand rapidly and impart tremendous shock. The 9MM is the typical example used in this regard.
I tend toward the first school although my primary home defense weapon is a Ruger P94 in 40 S&W and it is accurate and totally reliable. My carry weapon is a 357 mag 2 1/2" revolver which is an excellent caliber as well. If I haven't given you a definitive answer it's because I don't think you can go wrong with either. I own both but my go to is the 40 just because of reliability issues with my 1911 45 and I favor a double action auto as I'm uncomfortable with the cocked and locked of a single action auto.