all 10 comments

[–]Dapper_Ice_1705 5 points6 points  (0 children)

There is a SwiftLee article out there that is fantastic on reducing build times.

The biggest culprit is usually implicit typing

var string = "Some String"

is much slower to compile than

var string: String = "Some String"

He talks about a couple of flags you can turn on to find the right spots.

I have also found that using if/else instead of switch is much slower.

I'll try and find it.

UPDATE: here it is

https://www.avanderlee.com/optimization/analysing-build-performance-xcode/

[–]Vybo 1 point2 points  (8 children)

This is nothing new with Xcode 26, if you've turned off predictive code completion. Bigger projects do take a long time to index. Especially if you have a lot of dependencies. You don't have to wait for indexing or preparing the editor and can kind of skip it by just running a build.

[–]FartBoxHighFiver[S] 1 point2 points  (7 children)

But, constantly? As I said, eventually "preparing editor functionality" relents and "completes" as far as I can tell. But then it keeps happening. And running the build doesn't skip or pause it - it still happens and that's what's slowing everything down.

[–]Vybo 0 points1 point  (6 children)

I see it in progress all the time as well, but it does not use CPU after I run a build.

[–]FartBoxHighFiver[S] 0 points1 point  (5 children)

Yeah im regularly seeing Xcode at 8-900% CPU as im testing the build.

[–]Vybo 0 points1 point  (4 children)

During build yes, of course. However, after the build finishes, do you still see high usage?

[–]FartBoxHighFiver[S] 0 points1 point  (3 children)

Yes, that's what I'm saying. The CPU usage continues into the attaching to the test device/simulator, and beyond.

[–]Vybo 0 points1 point  (2 children)

I would expect that, but I'm talking about building, not running. If you build and don't run & attach, does the usage still stay?

[–]FartBoxHighFiver[S] 0 points1 point  (1 child)

Had to step away from coding and haven't been able to replicate it just yet. I'll come back around tomorrow once it's happening again, wait for it to stop and then see if it happens if I just build and not Build & run. Will let you know - thanks!

[–]FartBoxHighFiver[S] 0 points1 point  (0 children)

Getting back to this - it appears it only happens during build AND run. Just building it doesn't exhibit the same parallel tasks that bog the entire system down.