简体   繁体   English

Xcode 14 个缓慢的增量构建

[英]Xcode 14 slow incremental builds

After updating to Xcode 14.0 (happens still for 14.0.1, and 14.1) I felt massive slowdown in incremental build times even if changing just a single property.更新到 Xcode 14.0 后(仍然发生在 14.0.1 和 14.1 上)即使只更改一个属性,我也感到增量构建时间大幅放缓。 For my project it's 3x, but read about 10x or more.对于我的项目,它是 3 倍,但阅读大约 10 倍或更多。

To fix that, you simply need to add user defined build setting SWIFT_USE_INTEGRATED_DRIVER and set it's value to NO you can do so by going to project navigator -> select your target -> Build Settings -> Now you need to click on the plus in the section below and tap "Add User-Defined Setting"要解决此问题,您只需添加用户定义的构建设置SWIFT_USE_INTEGRATED_DRIVER并将其值设置为NO您可以通过转到项目导航器 -> select 您的目标 -> 构建设置 -> 现在您需要单击加号下面的部分,然后点击“添加用户定义的设置”

在此处输入图像描述

Xcode should scroll to the field and focus on it automatically, but if not scroll to the bottom or search for your field in the filter on the right and set your value to "NO" Xcode 应该滚动到该字段并自动关注它,但如果没有滚动到底部或在右侧的过滤器中搜索您的字段并将您的值设置为“否”

This topic is covered more broadly on swift forum and this is from where I got this fix这个主题在swift 论坛上有更广泛的介绍,这是我得到这个修复的地方

I believe this is a temporary solution, due to some swift driver issues, if I found it to be no longer needed.我相信这是一个临时解决方案,由于一些 swift 驱动程序问题,如果我发现它不再需要的话。 I'll update the answer.我会更新答案。 From my own observations, I can't see any parallel compilations tasks being run with the driver on.根据我自己的观察,我看不到任何在驱动程序打开时运行的并行编译任务。 Only one big emit module for main app target.主要应用程序目标只有一个大的发射模块。

Xcode 14.1 has the same bug. Xcode 14.1 有同样的错误。 Due to the previous answer I've updated from 14.0.1 to 14.1 today and the build times increase from build to build in exponential manner, below tested for the first 10 subsequent compilations without (:) any changes to the code base:由于之前的回答,我今天从 14.0.1 更新到 14.1,并且构建时间以指数方式从构建增加到构建,下面测试了前 10 个后续编译,没有 (:) 对代码库进行任何更改:

Update: The problem occurs only after the first debug run with or without change the code base.更新:问题仅在第一次调试运行或不更改代码库后出现。

在此处输入图像描述

Interestingly the time cannot understand by sum up the part times shown in the build statistic:有趣的是,时间无法通过总结构建统计中显示的部分时间来理解:

在此处输入图像描述

Deleting derived data folder doesn't resolve the problem.删除派生数据文件夹不能解决问题。 The only working workaround is to close/open the whole project, making some changes, compile, close/open etc. It's a mess.唯一可行的解决方法是关闭/打开整个项目,进行一些更改、编译、关闭/打开等。这是一团糟。

The last Xcode update (1 November - Version 14.1.0) fixed the issue for me.最新的 Xcode 更新(11 月 1 日 - 版本 14.1.0)为我解决了这个问题。 When i updated to 14.0.1 i felt massive increase in the build time, it was extremely slow.当我更新到 14.0.1 时,我感到构建时间大幅增加,速度非常慢。 Now i can't say is it like before, but for sure it's better.现在我不能说它是否像以前一样,但可以肯定它更好。

Here is the summary:这是摘要:

  • Xcode 14.0.0 - Builds fast Xcode 14.0.0 - 快速构建
  • Xcode 14.0.1 - Builds very slow Xcode 14.0.1 - 构建速度非常慢
  • Xcode 14.1.0 - Builds faster than 14.0.1 Xcode 14.1.0 - 构建速度比 14.0.1 快

You can also try to download and install an older version from here , if the update doesn't work for you.如果更新对您不起作用,您也可以尝试从此处下载并安装旧版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM