1

I have a project (big project), that takes about 30 minutes to be indexed by Xcode. Xcode consumes 100% of my CPU for 30mn.

OK why not, that sounds a bit rude to use 100% of the CPU for a background task, but why not.

Now, if after 30 minutes, I quit Xcode, and re-open it, without touching a single file of my project, it starts again to index for 30 minutes.

Is this the intended behaviour? Is there a way to fix it? I don't want to turn off inedxing, I tried it, and code completion is HS.

jptsetung
  • 9,064
  • 3
  • 43
  • 55
  • 1
    Possible duplicate of [Xcode 9 keeps indexing at 100% of CPU](https://stackoverflow.com/questions/49233265/xcode-9-keeps-indexing-at-100-of-cpu) – Paul R Mar 14 '18 at 10:17
  • Are the project files on a native file system (e.g. local hard disk) or are they on some kind of server or file share ? – Paul R Mar 14 '18 at 10:18
  • Yes native file system. – jptsetung Mar 14 '18 at 13:11

1 Answers1

1

Try adding this flag to your build settings.

Xfrontend -warn-long-expression-type-checking=400

build settings flag

It will cause warning where the compiler take a long time to deduce a complex expression.

warning

This may cause a build error which will go away after you find the slow expressions and then remove the build flag.

greencardigan
  • 393
  • 1
  • 3
  • 13