It is strange, as even with M1 processor -warn-long-..
threshold < 5ms should emit tons of warnings AFAIR.
I'm building on an M1 Max, fwiw...
So this looks very different from your screenshot, and most of my other Swift codebases! Those two bars contain all (or very close to all) of the source files that are being built, one is for arm and the other x86. What is it making it clump all the source files into one step?
I'm also not sure why it's building for x86, given its iOS only and I'm running on an M1?
Sorry, one project with all of the code, and two targets - the application, and unit tests.
Looks like you're building universally, and one of the files in those batches is taking a long time to build. You may need to ensure you're only ever building for active architectures in the project, then you can investigate which file is taking so long to build.
I have a naive approach which helped me to identify code change (files actually) that slow down compiler. I monitored build log in Xcode when compiling code. If build log stopped scrolling down for a considerable amount of time, I opened terminal and ran "ps -ef | grep swift". That helped me to find the files being compiled. Then I inspected code changes in these files. In my experience, it's type interference that slow down compiler in most cases and this approach usually works for me (I didn't know build timeline or those settings until I read this thread).