IWYU takes waaaaaaay longer to compile?

Ever since switching, now whenever I make the smallest change, it compiles every single class in my project, including their .gen files. Each one takes up to 5-10 seconds.
Compile time has gone from 15 seconds of ‘creating library’ to now upwards of 10 to 15 minutes of compiling every class.
Can someone please give me some ideas, I’m wasting entire days now from how long it takes just to do anything.

Here’s my build.cs setup. I heard bEforceIWYU actually needs to be toggled off for this to work.

Any thoughts? Maybe anything else in my project that potentially may be causing this?

Thanks!

Have you tried getting rid of the shared PCH files?

How would I do that?

Also I just loaded up an older project to test. It too compiled all the headers but did it extremely quickly. Took 105 seconds (1.5 minutes) to compile, compared to the IWYU which takes it’s time on each header, taking 640 seconds (over 10 minutes)

Thanks
Edit: Whoops, just realized I’m posting on the wrong account.

For all classes that reference other classes are you:

  • putting #includes only in .cpp files
  • forward declares only in .h files

Speeds up build times noticeably.

Yep, .h files have no includes with all forward declaration.
.cpp files have includes.

But, I took all my old code (used a diff program to get all my new changes) and swapped back to not using IWYU.
Like before it compiled every single header (110 of them) but did so in only 43 seconds as apposed to 10+ minutes.

Unsure why IWYU compiled each header so drastically slow for me, but I’m no longer using it so it’s no longer an issue.

Thanks for the help though!