I built a few potato cannons in 2001. I spent some time designing the optimum 1:1.5 chamber-to-barrel ratio volume and working out the exact lengths so the projectiles would launch as far as possible given the size of the cannon and fuel used. If the barrel is too short you waste energy, if the barrel is two long then you use some energy to overcome unnecessary friction reducing muzzle velocity and ultimately range.
I also designed the cannon shown to easily disassemble between the barrel and chamber making it both more portable and easy to experiment with barrel length.