in reply to Efficiency of seek

llancet:

The easy question first: Bad news--It's a costly operation. Generally, if you're forced to make the heads move, you're talking 5+ milliseconds (and the 5ms is probably a high-end drive).

The good news: Modern drives typically read an entire cylinder at a time, so if your seeks are mostly local, you can often bypass the head motion. (The more platters in your drive, the more information in the cylinder.) So when you preprocess the file, try to arrange things to keep the seek distances small, and you'll have fewer head movements.

When a head motion occurs, it has a trapezoidal motion profile: At the start of the movement, it accelerates to "top speed" which is a constant-time operation. At the end of the movement, it decelerates back to zero speed, which is another constant-time operation. After that, it takes a little time to stabilize the motion and sync up with the servo track. Between the start and end of the movement, the heads travel at a fixed velocity, so the more tracks you cross, the more time it will take. (However, I doubt it matters much, as I believe (no evidence) that the time is dominated by the speed up, slow down and synchronize operations.) (Note: I glossed over a good few details, such as short head movements in which case the speed up never gets to full speed before the heads start slowing down.)

Note: I'm not a hardware manufacturer, though I play one on TV.

...roboticus

When your only tool is a hammer, all problems look like your thumb.

Replies are listed 'Best First'.
Re^2: Efficiency of seek
by JavaFan (Canon) on Aug 31, 2011 at 12:56 UTC
    It's a costly operation. Generally, if you're forced to make the heads move, you're talking 5+ milliseconds (and the 5ms is probably a high-end drive)
    Technically, you're only playing the price when reading (or writing) after the seek. And then only if the requested page isn't already in the buffer. The seek itself doesn't move the heads. And you may have to pay said price anyway, even without seeking. The heads may stay at the same spot if your process is the only one accessing the disk.

      JavaFan:

      Yep, very true. That's among the stuff I was glossing over (I also didn't want to talk about caching on the drive, in the OS, and whatever other optimizations exist.)

      ...roboticus

      When your only tool is a hammer, all problems look like your thumb.