12 to 16 inches I feel is best, around 38 to 40cc of air, around 80mm stroke give or take... I chopped a 35 barrel down a few yrs back from 19 inches to under 10 and ruined it, however i did do it in 1 inch sections as i was curious and found 16 was more powerful than 19, around 14 it lost around 1/4fpe, 12 inches 1/2fpe (which is easy to gain back) at 10 it lost around 1fpe and under 10 (seem to remember it was 8 inches but can't be sure now) it lost near 2fpe....i ended up buying a new barrel...pretty stupid as it was my first ever gun.
Some of my most accurate HW springers have been 19inch barrels shortened to 14 > 16inches, i have a 77 that was chopped to K length and its stunningly accurate.
For a .22 I would probably go to 14 inches, add a shroud that overhangs 2 inches with a few baffles inside and finishes around 4 inches from the breech with a feathered taper...a .177 may need a bit more weight so a little longer. (20mm od) and maybe more efficient with a barrel 16inches long.