美文网首页
无标题文章

无标题文章

作者: allen852 | 来源:发表于2017-03-30 18:21 被阅读0次

二叉搜索树  反转二叉树


41.性能优化

1.合理的线程分配,过多线程创建会导致消耗过多

DB操作、日志记录、网络回调都在各自的固定线程

2.预处理和延时加载

对于一些需要耗费大量线程时间的操作,并且需要及时地显示在用户面前,提前放到后台线程进行计算

UITableView就是最典型的例子(对于可视区域外的cell适当地进行延迟加载)

3.缓存

cache线程安全问题,防止一边修改一边遍历的crash。

cache的根据需要建立缓存释放机制,防止缓存数据过大。

4.使用正确的API

了解imageNamed:与imageWithContentsOfFile:的差异(imageNamed:适用于会重复加载的小图片,因为系统会自动缓存加载的图片,imageWithContentsOfFile:仅加载图片)

NSString *imagePath = [[NSBundle mainBundle] pathForResource:@"apple"ofType:@"png"];

UIImage *appleImage = [[UIImage alloc] initWithContentsOfFile:imagePath];

缓存NSDateFormatter的结果,过多地创建会影响影响性能(使用当前线程字典来保存对象,时间格式作为键值)

5.数据库优化

主要是合适地建立索引,提高查找效率,防止全表扫描。



TableViewCell \ 页面优化:


TCP三次握手:


automaticallyAdjustsScrollViewInsets


nsurlcache 网络访问缓存 refresh Time Profiler  object_setIvar   

相关文章

  • 无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标

    无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章 无标题文章无标题文章无标题文章无...

  • 无标题文章

    无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章

  • 无标题文章

    无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标...

  • 无标题文章

    无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标...

  • fasfsdfdf

    无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标...

  • 无标题文章

    无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标...

  • 无标题文章

    无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标...

  • 无标题文章

    无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标...

  • 无标题文章

    无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章

  • 无标题文章

    无标题文章 无标题文章 无标题文章无标题文章 无标题文章 无标题文章

网友评论

      本文标题:无标题文章

      本文链接:https://www.haomeiwen.com/subject/fijagttx.html