main()之前耗时测量
-
测量app的整个启动时间 (Instruments→ App Launch)
-
通过添加环境变量可以打印出APP的启动时间分析 (Edit Scheme → Run → Arguments → Environment Variables) 添加 DYLD_PRINT_STATISTICS_DETAILS
(Edit Scheme → Run → Arguments → Environment Variables) 添加 DYLD_PRINT_STATISTICS_DETAILS 打印dyld的加载耗时
ObjC setup time
是 map_images 的时间
total time in initializers and ObjC +load
初始化和load加载和执行的总耗时耗时,包括attribute ((constructor))
-
添加环境变量
OBJC_PRINT_LOAD_METHODS
,值为 1.可以 打印出app有哪些 +load 方法 -
load方法耗时测量 开源工具: https://github.com/binzi56/A0PreMainTime
main()之后耗时测量
- App Launch 查看 Samples
- 应用开源工具 https://github.com/QiShare/Qi_ObjcMsgHook/tree/master/Qi_ObjcMsgHook/Qi_ObjcMsgHook/QiLa