I went 10.5". First the US Army settled on that as the minimum length barrel for use back in 1965. That is entirely due to it being the shortest length barrel that still produces effective ballistic results with minimum operator difficulty and the highest reliability. Even then the follow on models got sound moderators which are now classed as silencers. Shorter barrels are much more ineffective - the point of the gun is to be able to launch a bullet at a live target and stop it from fighting back. 10.5" does that, shorter barrels don't and the effectiveness drops rapidly .
Second it's long enough to actually grip forward of the magazine in a useful manner, which helps stabilize the sight picture. There's enough to grip and also mount optics or accessories. It's long enough with carbine gas to accept carbine length handguards, and I don't need expensive custom length ones.
In total that's why it's still the preferred military weapon for ship boarding and clearing parties or use in restricted urban areas - the same conditions as it was meant to be used in Vietnam, tight quarters with the enemy close at hand. Being short it had the advantage compared to the AK47 or even longer SKS in close combat.
I built mine as a 10.5 with carbine gas and B5 handguards with FSB and a Black River Tactical linear on it. Weighs 5.5 pounds and cost less than $100 a pound to build. Somebody buried a brake under an expensive float on one and it turned out ugly:
http://www.thefirearmblog.com/blog/2016/06/14/potd-3/ An 8" would have had another 25% higher gas velocity with even more damage. You can go too short.