I prefer the 40cal.
Here's some info on your question.
The 40 caliber is really a 10mm round that has been shortanded and loaded to reduce the energy. The FBI, who requested this, wanted a more powerfull round that could be put in a handgun with a large ammo capacity. The 10mm had too much recoil for some of the small agents and they reduced recoil by lowering the energy and the .40 caliber was born.
The 40 caliber is a larger, heavier round that moves (depending on the brand) almost exactly the same velocity as the 9mm Luger (about 1100 feet per second). The 40 has a heavier bullet (from 155 to 180 grain) vs the 9mm (from 115 to 147 grains). This gives the 40 caliber more energy (361-479 ft-lbs) vs the 9mm ( 310 to 341 ft-lbs).
The 40 caliber also has a greater efficiency in that it's larger diameter is better at transferring energy. This assumes that you are using the same bullet type. A 9mm hollow point will out perform a .40 caliber FMJ bullet. Hollow points are much more efficient at transferring energy.
So the 40 caliber is the winner in stopping power. Here is a link that shows you the ballistic tables for most common rounds. http://www.hornady.com/images/ballistics…