File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 46461 . 编译时,Clang 的 ` -fprofile-instr-generate ` 选项会在程序中插入计数器 (` __profc_* ` ) 和元数据 (` __profd_* ` ) 到特定的 ELF 节中,并在关键执行点插入 Load/Add/Store 指令进行实时计量。
47472 . 运行时,LLVM 运行时库通过 ` atexit() ` 钩子,在程序终止时自动将内存中这些节的最终数据序列化到 ` .profraw ` 文件中。该文件依次包含 Header、Data 段(元数据)、Counters 段(执行次数)和 Names 段,完整记录了代码执行轨迹。
4848
49+ ### [ Teaching AI to Read Xcode Builds] ( https://tuist.dev/blog/2025/11/27/teaching-ai-to-read-xcode-builds )
50+
51+ [ @zhangferry ] ( zhangferry.com ) :Xcode 原始构建日志对人和 AI 都不够友好,仅提供扁平信息输出。作者通过截获 Xcode 与 SWBBuildService 的通信,挖掘出日志之外的结构化数据,包括构建依赖、详细耗时等核心信息,现在随着 [ swift-build] ( https://github.com/swiftlang/swift-build ) 的开源,可以更系统的了解这些构建信息,利用它们可以实现这些功能:
52+
53+ * 精准排错:链接错误源于 NetworkKit 模块构建失败,其依赖的 CoreUtilities 正常,问题仅集中在 NetworkKit 本身
54+ * 慢构建分析:47 秒构建中仅 12 秒是实际编译,其余时间用于等待代码签名;8 核 CPU 仅达成 3.2 倍并行,XX 模块是主要瓶颈
55+ * 主动提醒:近一个月构建时间上涨 40%,与 Analytics 模块新增 12 个 Swift 文件相关
56+ * 自然语言查询:支持 “上次构建最慢的模块是什么?”“上周比这周多多少警告?” 等直接提问
57+
58+ 利用这项能力对 Wikipedia iOS 应用完成 “体检”,找到多个编译耗时瓶颈,AI 还结合结果给出了模块拆分、并行处理的优化建议。
59+
60+ 未来潜力更值得期待:若 Apple 官方支持实时获取构建消息,AI 可在构建中途发现异常(比如 “某模块比平时慢 2 倍,是否暂停检查?”),还能实时监控 CI 构建进度,甚至自动修复问题。作者基于 swift-build 开发了 [ Argus] ( https://github.com/tuist/argus ) ,已经实现部分实时功能。
61+
4962## 工具
5063
5164### 🐕 [ https://github.com/CodeEditApp/CodeEdit ] ( https://github.com/CodeEditApp/CodeEdit )
You can’t perform that action at this time.
0 commit comments