如何在基于 SSD 的 Mac 上模拟正常硬盘性能?
我想要什么
我想在基于 SSD 的开发机器上模拟普通硬盘的性能。
背景
我正在使用 SSD 的 Macbook 上开发 Mac 应用程序。速度快得惊人。
如果有人有标准盘片硬盘驱动器,我的应用程序对他们来说会更慢。我的应用程序也很注重核心数据,因此磁盘访问速度将是一个重要因素。
我担心我用 Instruments 进行的性能测量看起来不错,但当客户在他们的普通硬盘上运行我的应用程序时,速度会非常慢。
我的尝试
在安装 SSD 之前,我在 Instruments 中测量了应用程序的性能。安装后,我再次测量了它,两个基准测试是相同的。
这对我来说没有意义。我确信我在这里做错了什么。仪器可能测量时钟速度,而不是墙上时间速度。但是,硬盘的速度肯定会影响我采取的基准吗?或者 Instruments 是否能以某种方式弥补这一点?
What I Want
I want to simulate the performance of a normal hard drive on my SSD based development machine.
Background
I'm developing a Mac application on a Macbook with an SSD. It's gloriously fast.
If someone has a standard platter hard drive, my app will be slower for them. My app is heavy on Core Data too, so the disk access speed will be a significant factor.
I worry that the performance measurements I take with Instruments look fine, but when a customer runs my app on their normal hard drive it will be achingly slow.
What I've Tried
Before I installed my SSD, I measured the performance of my app in Instruments. After the install, I measured it again and the two benchmarks were identical.
This doesn't make sense to me. I'm convinced I was doing something wrong here. Instruments probably measures clock speed, not wall time speed. But still, surely the speed of the hard drive should affect the benchmark I took? Or does Instruments somehow compensate for this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
感谢上面的@PaulR,他建议使用外部 USB 硬盘来测试性能。谢谢!
Kudos to @PaulR above who suggested using an external USB hard drive to test performance. Thanks!
您可以使用虚拟机并限制磁盘访问。通过这种方式,您应该可以控制磁盘速度......仍然不可能限制仅写入或仅读取。
以下是有关如何在 Virtualbox 5.8 中执行此操作的一些提示。限制磁盘映像的带宽 https://www.virtualbox.org/manual/ ch05.html#存储带宽限制
You can use a Virtual Machine and throttle disk access. In this way you should have control over disk speed.... still not possible to limit only writes or only reads.
Here are some tips about how do it in Virtualbox 5.8. Limiting bandwidth for disk images https://www.virtualbox.org/manual/ch05.html#storage-bandwidth-limit