Virtual hard disks versus a physical drive. Better performance?

The creation of a VHDX or VHD is relatively simple within Windows 10, or even Windows 8.x, but what was mentioned here is better performance, which caught my interest.
The only referene to performance is that VHDX performs better than VHD. They will both perform worse than a real drive, because there is another layer of software between the application and the hardware.
 
The only referene to performance is that VHDX performs better than VHD. They will both perform worse than a real drive, because there is another layer of software between the application and the hardware.

That's exactly what I was thinking, though I did see some forum posts saying the opposite due to how the virtual data is cached versus how the blocks are managed on the physical drive. VD do have the advantage of being a single file that is defragmented by the host, but the data its self needs to be defragmented as well. This is all of course on a hard disk and not an SSD. If the physical drive is an SSD, there data cannot be defragmented even on the virtual disk.
 
TANE / trainz uses lots of small files so the biggest problem is they will tend to scatter across the drive. Note scatter not fragment. Track to track movement is the slowest part of any physical hard disk access. By sticking the small files in one big file the theory is that loading the big file is quick as you can slurp up a lot of data as the disk rotates. If you have enough memory your Win 10 will cache the file as well.

Would it be better than SSD probably not. Could it be better than a physical hard drive, possibly yes but working out the optimum file size for the virtual disk and the cost of lots of memory probably means for most its not worth the effort.

Delay due to software, well hard disks are measured in millisecs, memory in nano seconds. There are a lot of nanoseconds in a millisecond. Will the extra processing requirement on the CPU slow down other processes? If you have a 12 core probably not, two core it probably will.

How was that for a definite answer.

Cheerio John
 
I have no idea if a virtual drive would be beneficial for Trainz or not but I do know that should Windows or worst still your computer go down without very frequent backups there may not be a lot of Trainz left to recover. Peter
 
TANE / trainz uses lots of small files so the biggest problem is they will tend to scatter across the drive. Note scatter not fragment. Track to track movement is the slowest part of any physical hard disk access. By sticking the small files in one big file the theory is that loading the big file is quick as you can slurp up a lot of data as the disk rotates. If you have enough memory your Win 10 will cache the file as well.

Would it be better than SSD probably not. Could it be better than a physical hard drive, possibly yes but working out the optimum file size for the virtual disk and the cost of lots of memory probably means for most its not worth the effort.

Delay due to software, well hard disks are measured in millisecs, memory in nano seconds. There are a lot of nanoseconds in a millisecond. Will the extra processing requirement on the CPU slow down other processes? If you have a 12 core probably not, two core it probably will.

How was that for a definite answer.

Cheerio John

That was a definitely a definite answer! :)

I have 64GB of RAM so a lot gets cached up there in memory as well as an Intel E5930K so the processing isn't an issue, might give it a try and find out. I've backed up my data of course already.


I have no idea if a virtual drive would be beneficial for Trainz or not but I do know that should Windows or worst still your computer go down without very frequent backups there may not be a lot of Trainz left to recover. Peter

Backups are part of my operational procedure. I worked in IT for over 25 years and did the backups religiously as part of operating procedure, which has now ben engrained into my being since that level of paranoia sits there all the time that something might crash! I also have my system sitting on a UPS to prevent power hits. I will admit I did lose a complete system once, but had 99% of my data and was able to recover everything but the most recently created documents and videos.

The other thing I've read on the virtual volumes is they are more resilient to system crashes due to how the data is handled. This still doesn't mean letting things go and not bothering with a diligent backup schedule.

So it's something to try and I'll report back. No I won't delete my data from my physical hard disk just yet!
 
Here's an update on the virtual drives.

I setup a virtual VHDX "T: drive" as my T:ANE data drive. I made the drive a bit more than my content as it's initial size and set it to grow-able so the size can expand as needed. With a nearly a terabyte of data, this took nearly 15 hours to import from the physical disk location. Once imported, I defragged the host drive and then defragged the VHDX file.

Creating and mounting the drive took seconds and so did formatting the virtual disk.

I placed the VHDX drive in a separate folder called "VIRTUAL HARD DRIVE - DO NOT DELETE !!!" with the actual VHDX file called TANE_DATA_VHD.vhdx

Once the data was copied, I repointed my T:ANE install to that location and loaded up the program.

I've been comparing the access times to my on the hard drive versus that in the virtual disk.
The performance is a bit faster than it was on the physical disk since the disk access is faster overall due to the data being hosted in a contiguous file rather than as individual files on an I/O bound hard disk. This also has the advantage with backups and data copying especially with Trainz data due to the Trainz data being made up of many small size files, which eat up a lot of I/O cycles. The single VHDX file also has the advantage of being transportable too since a single file can be copied that contains everything instead of needing to select multiple folders and files.

For SSDs I'm not sure if there is an advantage to this because there is less I/O issues with SSDs compared to platter-type hard disks.
 
I'd invest in an SSD rather than mess with all of that. They can be had relatively cheap now a days.
 
I'd invest in an SSD rather than mess with all of that. They can be had relatively cheap now a days.

SSDs are a different beast, besides the size needed to hold large amounts of data are too expensive. For my Trainz data, for example, I need at the minimum 2TB disks which are well beyond my budget. SSDs also suffer from wear down issues, which is a concern with lots of data writes. Yes, they handle the I/O better, but Trainz, any version, writes a lot of data to the disks which will cause premature wear down. It's the nature of the beast with solid-state technology, which until solved, makes SSDs remain the realm of boot and program drives and data remains on the old-fashioned drive. Sure SSD technology has gotten better, including the reliability, and statistics show they're no worse than or better than hard drives, but those are only statistics and statistics don't show real life. What I at least don't want is to power up one day and find an inaccessible drive, which is bound to happen rather suddenly with solid-state drives.

Creating and mounting a VHDX drive (VHDX is the extended sizes up to 64TB), is no different than formatting a regular physical disk, though mounting the drive is a bit different and the drive is a large file versus a physical disk. Formatting and creating takes seconds, and the access is much faster due to being a single file which is cached better.
 
Last edited:
The performance is a bit faster than it was on the physical disk since the disk access is faster overall due to the data being hosted in a contiguous file rather than as individual files on an I/O bound hard disk.

That's the same improvement that you would get by copying the installation to a new, empty hard drive. That has the same effect of making each individual file contiguous, and putting all the files in the same portion of the disk. I/O cycles are not affected by the existence of many small files if they are co-located because the combination of Windows and hard drive buffering means that I/O is minimal for multiple co-located small files. The fact that the VHD is contiguous does not affect seek times - the system still has to seek within the contiguous file if the small files it contains are scattered throughout the contiguous VHD file. Backup is a good point however, becasue the OS look-ahead buffering is likely to be more effective for that procedure than for normal random access.
 
Funny, I was actually wondering recently if it wouldn't be a good idea for a future version of Trainz to use a single disk image or archive file, or a small number of such files, to store committed assets instead of storing all the individual asset files and folders directly on disk. A heavily-loaded Trainz installation contains tons upon tons of folders and small files, and even with a high-speed eSATA connection that can reach transfer speeds approaching 150 megs per second, the speed when backing-up Trainz sinks to one comparable to USB 2 simply because of the overhead of sifting through hundreds of thousands of files and folders. A handful of large files constituting the same number of gigabytes are handled much faster. Preferably such image or archive files would be of a standard format that one could open with easily-obtained tools to retrieve the contents in an emergency.
 
That's the same improvement that you would get by copying the installation to a new, empty hard drive. That has the same effect of making each individual file contiguous, and putting all the files in the same portion of the disk. I/O cycles are not affected by the existence of many small files if they are co-located because the combination of Windows and hard drive buffering means that I/O is minimal for multiple co-located small files. The fact that the VHD is contiguous does not affect seek times - the system still has to seek within the contiguous file if the small files it contains are scattered throughout the contiguous VHD file. Backup is a good point however, becasue the OS look-ahead buffering is likely to be more effective for that procedure than for normal random access.[/FONT][/COLOR]

Very good point I never did attribute this to the fact that this is just a contiguous drive, and assumed it was due to the better seek time. I do defrag both the host physical drive and then the VHD afterwards to ensure that the drive is fully defragmented. I noticed long before using the VHD that this made a big difference and more so with T:ANE SP2 due to the larger number of smaller files, which is definitely a killer in the performance. But the access time though is better within the VHD, which I don't think is all related to the defragmented state. I need to do more reading up on this and hopefully I can see why.

There is definitely a difference in the performance during backups because of the continuous read rather than the stop-start I/O operation of all the smaller files.
 
Back
Top