A Glock 34 barrel is longer than a Glock 17 barrel. While the Glock 17 is chambered in 9x19mm and designed for a standard length barrel, the Glock 34, also chambered in 9x19mm, features a longer barrel and slide assembly for improved sight radius and accuracy. Directly swapping a Glock 34 barrel into a Glock 17 frame requires consideration due to the difference in slide lengths.
Using a longer barrel, like that of the Glock 34, in a shorter slide, like that of the Glock 17, is generally inadvisable due to potential safety and reliability issues. However, conversion barrels designed specifically for the Glock 17 exist that offer extended lengths similar to the Glock 34 barrel. These aftermarket barrels are engineered to function correctly with the Glock 17 slide and offer benefits such as increased muzzle velocity and potentially improved accuracy, mimicking some advantages of the longer Glock 34 configuration without requiring slide modification. The desire for longer barrels within the Glock platform stems from the competitive shooting community where even slight improvements in sight radius and velocity are highly valued.