Hard drive testing

JohnGalt47

Member
Jun 26, 2001
52
0
0
I wrote the following little VBA program to test various drives in different computers. All the drives in my home computer test the same. I have two 150 gig Raptors in RAID 0, one 150 gig Raptor X for C drive, one new Velociraptor as D, and a Hitachi 7K1000 1 terabyte drive. They all take 38 seconds to run the following program. I don't understand why.
=======================================================
Private Sub StartBtn_Click()

Dim str1 As String
Dim x As Long
Dim start_Time
Dim stop_Time
Dim Total_Time

start_Time = Time

StartTimeLabel.Caption = start_Time

Open "j:\OutFile.txt" For Output As #1

For x = 1 To 6736832

str1 = "abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789"

Write #1, str1

Next x

Close #1

stop_Time = Time
StopTimeLabel.Caption = stop_Time
Total_Time = stop_Time - start_Time

Debug.Print stop_Time
Debug.Print start_Time
Debug.Print Total_Time
End Sub
==========================================================

Anyone have ideas about this? (and yes, I change the drive letter when writing to different drives)
 

seemingly random

Diamond Member
Oct 10, 2007
5,277
0
0
Good initiative. It would be great if it's representative of average disk activity. Is it? Does it take into account random access (reads and writes) as well as sequential?
 

tank171

Member
May 27, 2007
93
0
0
I done know anything about VBA, but maybe this program is writing into your RAM instead of your HDD.
 

JohnGalt47

Member
Jun 26, 2001
52
0
0
It actually creates a file on the destination disk called Outfile.txt. I'm going to try another test which will copy lots of data from one disk to another using Karen Kenworthy's program called Replicator. It has the ability to time the file copying.

To answer seeminglyrandom's question, no, it does not do random access testing. I'll have to figure out a way to do that. It is just a simple sequential disk write.
 

RebateMonger

Elite Member
Dec 24, 2005
11,586
0
0
JohnGalt47,

I think you need to look at how Windows does caching nowadays. It's a lot more complicated than it used to be, and if a lot of stuff is coming from cache and you aren't compensating for that, you won't seen appreciable differences between disks.
 

seemingly random

Diamond Member
Oct 10, 2007
5,277
0
0
You first have to decide on your test criteria. Do you want to test the absolute performance of the hd - or do you want to test the performance of the hd in windows?

For absolute performance, there is a low level api available in windows (or linux, etc).

For windows performance, you need a way to test the hd part of a windows read or write operation.

In the above code, I would guess that the cpu and ram are being tested more than the hd. Depending on the amount of ram, the hd may (appears to be) not involved before the program displays the stop time. This is due to a concept known as write-behind. It simply means that the windows file cache is flushed (written to disk) independently of when a program does a write - usually determined by cache fullness or cache age (or with vista, it may be the alignment of the stars).

There's probably a way to flush the cache in windows - either programmatically via an api or through a series of operations that effectively flush it as far as your program is concerned by filling it with something unrelated.

- try this little test: open a command prompt (or run cmd.exe)
- execute the command: dir /s
{Depending on how many files are on the volume, the file directory entries will be in cache.}
- Do it again. notice how much faster it runs?

To illustrate further about test programs, do the following after rebooting (to clear the cache).
- open a command prompt.
- execute the command: dir /s \ >nul
- and again.
{This gives a more accurate portrayal of the actual disk activity - as opposed to the efficiency of writing to and scrolling the screen.}

The reason I point out the above is to draw attention to your test program. Not having much experience with vb, I don't know how efficient it is. For example, is the assignment to str1 done each time this line is encountered or is it optimized outside of the loop?

And, I've just scratched the surface of building a disk performance utility. I don't want to dissuade anyone from attempting this but, if you're not familiar with the internals and won't need this knowledge for anything else, an already existing utility might be the way to go.
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |