9

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?

John Gallagher
  • 6,208
  • 6
  • 40
  • 75
  • 3
    Why not just plug in an external hard drive and use that for testing ? – Paul R May 18 '11 at 13:31
  • What instrument were you using? – Eiko May 18 '11 at 13:52
  • @PaulR I can't change the directory that my data store is in, so it must always resides on my local drive. I also take my laptop with me everywhere and don't want to carry and external. – John Gallagher May 18 '11 at 18:09
  • @Eiko By "Instruments" I'm referring to the performance tool Apple provides with OS X Developer tools. That's what it's called. – John Gallagher May 18 '11 at 18:10
  • 5
    If the directory is hard-coded (and it *really* shouldn't be) then you can use a symbolic link to a directory on the external drive. Or you could make the external drive a boot drive for testing purposes. And as for carrying around an external drive, they are very small, and presumably you don't need to *constantly* test the performance ? – Paul R May 18 '11 at 18:12
  • @John Gallagher Yes, but *which* instrument of the dozens did you use? There are so many different instruments within Instruments. – Eiko May 18 '11 at 21:45
  • @Eiko Oh, sorry, completely misunderstood. The Time Profiler. – John Gallagher May 19 '11 at 16:39
  • 1
    @PaulR Hmmm. Good point. In terms of hard coding, I'm just using Apple's standard boiler plate code to find the users application support directory. Not got around to allowing the user a choice of where to have the data store yet. The symlink idea sounds like the best option so far. Thanks! – John Gallagher May 19 '11 at 16:41

2 Answers2

4

Kudos to @PaulR above who suggested using an external USB hard drive to test performance. Thanks!

John Gallagher
  • 6,208
  • 6
  • 40
  • 75
3

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

Adi Roiban
  • 1,293
  • 2
  • 13
  • 28
  • 2
    This is a good answer for most people. Problem is HDDs behave differently in ways besides just being slower. As you probably know, HDDs suffer disproportionally from seek time. In my case, I need the real HDD behavior since I'm trying to run a timing attack based on filesystem indices. – sudo May 15 '16 at 00:35