祁迪的博客

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

Chromium 这样庞大的工程,涉及超多的模块依赖,如何保证代码质量?源码中随处可见 xxx_unittest.cc 和 xxx_fuzzer.cc 这样的文件,它们是如何组织的呢?项目的每一个 Commit 需要执行哪些测试,流程是什么?Chromium 做了哪些基础的工作支持繁琐又重要的测试工作,我们是否可以借鉴用到自己的项目中?

Read more »

阅读源代码是程序员最重要的基本功之一,研读高质量的开源项目源码是进阶的必要手段。那么面对一个新项目时,如何高效快速地熟悉整个源码呢?

Read more »

买了公寓

买了一套公寓给父母住,总算是了却了心中一桩事

做了手术

左侧肩膀有个皮下肿物,每次洗澡都会关注是不是又长大,今年做了一个手术切掉了。病理分析结果是黑素纤维瘤,有恶变可能,幸亏及时割掉了。平时得多注意身体,发现有异常情况要及时去医院

Read more »

多线程是基础库非常重要的一部分,每个平台都有各自的多线程API,实现一套高效、易用的多线程基础库也是挺有挑战的。Chromium base库中有完整的跨平台thread封装和实现,本文主要整理一下Chromium 线程相关实现细节。

Read more »

背景

Runtime 是 Objective-C 特有的机制,iOS 进阶必须要掌握的知识点,面试过程中也会经常问。实际上也有很多开源库中,大量地使用 Runtime 来实现各种需求,比如大名鼎鼎的 JSPatch,YYModel 等。本文是我学习的笔记或随笔,内容可能比较散杂,由于 OC Runtime 内容很多,所以本文会不间断更新。先上一张思维导图,感受一下 OC Runtime 大体包含了哪些知识点。

Read more »

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 »
0%