朝元的博客


  • 首页

  • 归档

@synchronized, NSLock, pthread, OSSpinLock showdown, done right

发表于 2015-12-02 | 分类于 ios 进阶

Somewhere out there on the internet, there’s a “showdown” between @synchronized, NSLock, pthread mutexes, and OSSpinLock. It aims to measure their performance relative to each other, but uses sloppy code to perform the measuring. As a result, while the performance ordering is correct (@synchronized is the slowest, OSSpinLock is the fastest), the relative cost is severely misrepresented. Herein I attempt to rectify that benchmark.

阅读全文 »

关于 NSBundle 路径遇到的一点问题

发表于 2015-11-19 | 分类于 ios 基础

[1] 想要解决的问题

记忆蝰蛇音效最后加载的 .irs 或者 .wav 路径。

[2] 解决过程

[2.1] 能够想到的最简单的解决办法就是直接持久化保存即可。可以写到 plist 文件或者使用NSUserDefaults保存。最后选择了后者。.irs 文件放在工程 [NSBundle mainBundle]下的 irs 文件夹里面。

阅读全文 »
1…45
朝元

朝元

42 日志
10 分类
24 标签
© 2019 朝元
由 Hexo 强力驱动
主题 - NexT.Mist