Ballistics by the inch is the best source for information about the effect of barrel length on ballistics. Here is their page on .22 magnum.
(statement of intent)
www.ballisticsbytheinch.com
Short summary. The effect of barrel length on velocity is dependent on the cartridge and the specific load. .22 magnum is a cartridge that is very dependent on barrel length. From a 4" barrel, .22 magnum performance is similar to .22 long rifle from a rifle barrel. From a 2" barrel, .22 magnum rounds under perform compared to a .22 rifle. From a 6" barrel, .22 magnum improves significantly. For most .22 magnum rounds, the velocity increases 600-700 feet per second when going from a 4" barrel to a 19" barrel. But for some rounds, the velocity increase approaches 1000 fps.