> For the complete documentation index, see [llms.txt](https://ryukiedev.gitbook.io/wiki/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ryukiedev.gitbook.io/wiki/ios/you-hua/05.-ti-gao-bian-yi-su-du.md).

# 05.提高编译速度

## forward declaration

* 使用`@class ClassName`而不是`#import ClassName.h`
* 能大大提高编译速度

## 组件库打包优化

* 对不经常变更的库做成`Framework`或者`.a`
* 这部分代码就不需要重新编译了

## 常用头文件放到预编译文件里

* XCode的pch文件是预编译文件，这里的内容在执行XCode build之前就已经被预编译，并且引入到每一个.m文件里了。

## Debug模式下不生成dsym文件

## 开启编译当前架构版本

## Debug模式下关闭编译优化

![](https://img-blog.csdn.net/20161206231413542?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvSGVsbG9fSHdj/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast)

## 参考

> <https://blog.csdn.net/Hello_Hwc/article/details/53557308>
