I'll just point out that these days, installing always takes about 2 hours or more on my 2018 MacBook Pro. Xcode is just a pig.
That being said, if you have Microsoft Defender running, all bets are off. I always have to uninstall Defender before doing an Xcode upgrade.