Generally rimfire ammo will finish burning their powder around 18-20" so anything after that will start getting slower.
If you look at benchrest rifles, they're all 24"+ and from a handful of gunsmiths they will say that 24"+ length barrels have shown tighter SDs.
How much velocity is lost per " is hard to say. Varies from barrel to barrel and how tight the bore is. The tighter the bore, the also slower the ammo too. I would say an 18" barrel I would see velocities from the same lot of ammo at like 1095-1100fps, and from a 24" barrel, I would see it in the 1070s. So 6" changed the difference maybe 30fps? 5fps per inch?... again I haven't tested this with enough to remember.
Threading a barrel - you want the bullet leaving the barrel to be at a tight spot, and not a loose spot to guarantee the highest accuracy. So when you're threading a barrel, removing steel, could cause that area at the muzzle to become more loose. From a bunch of gunsmiths, they feel that the safe threading is 3/4" or more. 1/2"-28, the standard kind of smallbore threading, has a higher chance of reducing accuracy.