Xcode indexing takes forever

I was trying to perform refactoring in xcode. But, Xcode says indexing and this process seems to take forever. I also googled and found some stackoverflow [solutions][1] but that didn’t helped either

[

][2]

Machine Conf: 16GB RAM, 512GB SSD, Macbook Pro Retina 15-inch,

I’m having the same issue. Building from source taking 8+ hours on a beast i9 machine.