I agree with garyseven …. barrel length isn't the only issue related to accuracy. 19~20" is the optimum barrel length for a high velocity 22 LR …. 18" for standard velocity 22s. After these lengths, you will get a token increase in velocity on the order of a few fps …. not worth the inconvenience factor of a heavier and longer barrel.
Just because a barrel is longer, it doesn't mean it will be more accurate, in fact it could be just the opposite because it depends on the profile of the barrel. When a round is fired, every barrel will generate some harmonics, which are nothing more than vibrations caused by the bullet passing through the bore and making the muzzle move in a circular motion (same direction as the rifling). The heavier the bullet, the greater the effect from harmonics will be. Likewise, the faster the velocity, the greater the harmonic effects. The more massive (heavier) the barrel, the less it is effected by harmonics and the thinner the barrel, the more harmonics will make the muzzle move. Because a 22 LR uses a light bullet (40gr or less) and a slow MV, it won't be impacted near as much as a high power rifle with a much higher velocity and bullets that weigh considerably more. That said, 22 LRs can still produce enough harmonics to affect accuracy a little, especially with a thin profile factory barrel.
Obviously when the muzzle moves in a circle, POI downrange will change so you want to keep harmonics to a minimum. With a 22 LR, the best way to deal with harmonics is to use a heavy bull barrel or to use a shorter barrel. By Federal law, the minimum length for a rifle barrel is 16", which will work but you give up some muzzle velocity. Slower velocities take their toll on accuracy in the form of longer exposure to wind and gravity.
Most of the accuracy issues with any 22 LR rifle comes from "bullet damage". Some bullets, especially bulk grade are damaged right out of the box with dents, dings, and irregular shapes or weights. The feeding system, especially in semi autos, tend to influence even more bullet damage by "skinning" them during feeding. Excessive headspace or a loose chamber will also damage bullets because you lose precision bullet-to-bore alignment. Finally, the rifling itself can cause notable bullet damage if just one of the lands produces a deeper or more shallow engraving in the bullet. This type of damage results in a bullet leaving the muzzle slightly out of balance, which will make it yaw and go into a spiral at some point downrange.
So with all of that said, if you want the optimum accuracy with a 10/22, buy a 20 inch, .920" diameter match grade bull barrel with a Bentz chamber. The heavy profile virtually eliminates harmonics, a Bentz chamber will eliminate bore misalignment and the match grade bore will ensure near perfect engraving. By using match grade ammo, you eliminate any "pre-damage" and have cartridges with very uniform velocities and bullet weights.
Following my own advice, I built a 10/22 target rifle that will shoot groups under an inch at 100 yards, using Wolf Target/Match ammo. It has a Green Mountain match grade 20" bull barrel with a Bentz chamber. It also has a decent 3~10X42mm scope with a side dial, a Fajen target stock, and a bolt with minimal headspace. This rifle weighs about 12 lbs so it sure isn't intended for hunting but for benchrest shooting, it really shines.