Every time I decide to try a Jetbrains IDE again I give up after a few days. They're always eating insane amounts of RAM and lagging hard while indexing my code again and again and again.
Indexing is IO-heavy and does slow things down, that's the nature of it (and Windows is dramatically bad at that), but they have improved quite substantially in this department recently: whole indexes of large libraries/runtimes can be fetched from the internet so your computer won't be the billionth device to re-index the whole JVM, the IDEs are starting faster, and more features are being made available while indexing in progress (giving less of an impression that "nothing works" when opening a project).
The solution is to use an NVME SSD and stop programming on Windows.
NTFS is painfully slow for many-files type use cases. Unfortunately, many-files describes most codebases. Git clients on Windows are also painfully slow for this reason.
Not sure what to tell you, this should be solved on Macs. I'm pretty sure their SSDs are very fast. Although - be aware, the smaller capacity ones are about half the speed. They don't tell you that.