Xcode 15 has become really slow for C++ development

Since the Xcode 15 update, Xcode has become awfully slow. On a reasonably large project, the GUI thread blocks in various situations, such as changing compilation target, building... for sometimes more than 30 seconds. This kills the programming workflow, making Xcode almost unusable.