I can recall one of the gunwriters checking this out, probably in the '70's. He started with a long, maybe 26 or 28 inch barrel and cut it off about an inch at a time, thus same rifle, same barrel, just the length changed. I recall that the "sweet spot" with velocity was around 17 inches. Longer than that and they started slowing back down. Of course, there's always the chance that the barrel he used had a tight spot or directional constriction of some kind out past there....
Lead fouling in the barrel might create tight spots/constrictions. Keep in mind that there are some folks that don't believe in cleaning 22lr barrels, see Shreck's recent thread on cleaning his neighbors 22lr. I can see where fouling build up in a longer barrel might slow velocity down.
http://www.24hourcampfire.com/ubbthreads/ubbthreads.php/topics/8266207/1