祁迪的博客

企业级客户端技术探索:架构设计·性能优化·效能提升

iOS

性能优化

block

什么时候在 block 里面用 self, 不需要使用 weak self

我们知道, 在使用 block 的时候, 为了避免产生循环引用, 通常需要使用 weakSelf 与 strongSelf, 写下面这样的代码:

1
2
3
4
5
6
7
__weak typeof(self) weakSelf = self;
[self doSomeBlockJob:^{
__strong typeof(weakSelf) strongSelf = weakSelf;
if (strongSelf) {
...
}
}];

那么请问: 什么时候在 block 里面用 self, 不需要使用 weak self ?

Read more »

本文基于 Advanced Graphics and Animations for iOS Apps 整理,介绍了Core Animation和iOS GPU渲染管线的基础知识,以及如何profiling,定位和解决 UI 性能问题。

Creating a responsive UI requires an understanding of Core Animation and how mobile GPUs work. Learn about the iOS rendering pipeline in Core Animation, the new UIVisualEffectView and how it utilizes the GPU. Find out about the available tools for profiling UI performance. See how to identify and fix performance issues on a variety of devices.

Read more »

本文内容基于 Practical Approaches to Great App Performance 整理,这个Session主要介绍App 性能优化相关的问题,包括如何使用 Instruments 和其他工具解决性能问题,另外作者还介绍了他们对Xcode和Photos性能调优的一些实践经验。

All apps benefit from a focus on performance and an increase in overall responsiveness. This information packed session gives you strategies for fixing performance problems using Instruments and other tools. Additionally, get practical advice based on experience in tuning Apple’s own apps including Xcode and Photos on iOS.

Read more »

本文内容基于WWDC 2018中 Understanding Crashes and Crash Logs 整理的。这个Session主要介绍iOS Crash相关的知识:如何分析crash logs,怎么调试和修复crash问题,比如难以重现的内存问题和多线程问题。

Sudden app crashes are a source of bad user experience and app review rejections. Learn how crash logs can be analyzed, what information they contain and how to diagnose the causes of crashes, including hard-to-reproduce memory corruptions and multithreading issues.

Read more »

YYModel是一个高性能的 iOS JSON 模型框架,如果让我设计类似的框架,我能考虑到的几个关键点或者需要解决的问题有这几个:

  • 怎么实现JSON/Dictionary与Model的互相转换
  • 怎么保证类型安全
  • 如何做到对Model代码无侵入
  • Model嵌套如何支持
  • 如何设计性能测试benchmark
  • 性能方面的坑点
Read more »

偶然翻到前同事博客的一篇文章:阅读源码的乐趣,这位老哥是iOS开发领域的网红,相信很多人都看过他的博客。文章中他通过一个栗子详细描述了自己是怎么看源码的,强调看源码对扩宽视野,提高品味,锻炼思维等等各方面的重要性,个人觉得他这篇文章还是挺有指导意义的。

Read more »
0%