Six inches is probably about the minimum for the .22 magnum to start making a real difference.
Many years ago, a friend and I did some chrono testing with one of those tiny .22 revolvers. I can’t recall if it was a North American Arms or a Freedom Arms but it had a one inch barrel and two cylinders.
To make a long story short, there was only around 3 ft. lbs. difference between the .22 short, LR and magnum in that barrel length. Still technically the magnum had the most power but at an incredible amount of muzzle flash and recoil was pretty bad too. For those tiny revolvers, the .22 short is really the ideal cartridge.
If one measures barrel length from the back of the casing, I would expect that until one gets to a barrel at least 2" or so long (probably more like 3"-4", or maybe more) the extra distance a .22 short could travel before exiting the barrel would more than make up for the reduced amount of powder. Since the distance from the back of the casing to the muzzle is more relevant to concealability than the distance from the front of the cylinder to the muzzle, it would make sense to compare firearms where the former measurement is the same. And in such comparisons, at short barrel lengths, I would expect the .22 short to win.