let serialQueue = DispatchQueue(label: "Decode queue") func collectionView(_ collectionView: UICollectionView,prefetchItemsAt indexPaths: [IndexPath]) { // Asynchronously decode and downsample every image we are about to show for indexPath in indexPaths {serialQueue.async {let downsampledImage = downsample(images[indexPath.row])DispatchQueue.main.async { self.update(at: indexPath, with: downsampledImage)} } }
推荐阅读
- MySQL主从延时这么长,要怎么优化?
- SUV|赛道级性能SUV来了!星途凌云S正式上市:15.99万元起
- 安装win10后,所有电脑请这样设置,性能显著提升
- NVIDIA|NVIDIA RTX 3090 Ti显存超频24GHz:挖矿性能暴涨25%
- AMD|29小时惊人续航!AMD正式发布锐龙PRO 6000:首次纳入高性能H系列
- AMD|AMD Zen5锐龙8000曝光:混合架构冲击32核、IPC性能提升将超30%
- iphone13升级ios15.1好吗??iphone12mini升级ios14.7.1?
- 微软|坐等升级!Windows 11大更新22H2曝光:9月推送、重点改进UI、性能
- SEO的精益优化方法论
- 我如何将软件系统的性能提高35,000%