I prefer a 20" barrel for 22LR
I own or have owned 16" to 22"
Like the study J E showed us, length does not seem to have much effect on velocity. Like Hammer111 said, I too believe it's harmonics. If the barrel doesn't like the 22LR load as in the harmonics are discordant, the rifle may shoot slow, have poor accuracy or both.
There is no magic perfect formula except almost all rifles like Eley EPS. At $0.24 per shot it that is the way it should be.