Dear All, I recently had issue with the time expended to compile the code of a software I was working on, and I had to compile and recompile the software many times due to conditions that are not the moment to explain, I've performed many experiments trying to get the best performance out of my system. My intention here it's not to put in discussion which virtualization software is better, but to find out how to make my Fusion 12 to get better.
For information, all the tests bellow were performed in a MBP 2018 2.6 Ghz Intel Core i7 with 16Gb 2400MHz, they were all Win10 Pro with 6Gb of RAM and 6 Cores. The software to be compiled was an Industrial Automation software written in many languages using Siemens Step7 v5.6 for CPU 317F. The virtual machine had all the same software architecture and constellation of applications.
VMware Fusion Player 12: 9:49 min
-----------------------
Virtual Box 6.1: 5:33 min
---------------------
Parallels Desktop Pro Edition Version 16.1.
Hypervisor Apple: 16:06 min
Hypervisor Parallels: 04:02 min
Any guesses on what can be done to have Fusion performing better?
First, that's a 6 core machine, so no more than 5 cores should be allocated to any individual VM (4 would be better). That'll avoid starving the host and causing resource contention.
Second, make sure that all your source code is inside the VM, not on a shared drive folder or external drive. Shared folders have known performance issues when accessing many small files.
Hi @ColoradoMarmot , thank you for your time. I did reduce the amount of cores from 6 to 4 and made sure that all files are inside de VM, but unfortunately no significant change could the noticed.
Path to the project file.
Compilation after changes.
But I appreciate the tips. I would be very happy if I could just get close to the VirtualBox time.
Tks.
Hi,
There's a couple of factors that come to play with compiling speed.
Faster disk access helps.
Depending on the compiler, more threads might help.
As dlhotka already mentioned, it is best not to overprovision CPU resources. Yet in some typical heavy used multi thread processes it might still give you a little bit extra. As long as you don't start much processes at the host (running chrome would probably be noticable)
So that leaves us.. faster disk access.
There's a couple of things you can try.
Under settings -> advanced -> hard disk buffering
Most likely that is set to "automatic".. which is a good setting. Yet I suggest to try "enable" to see if it helps.
Since we're talking about buffering.. it would not be the initial compile that benefits.. but subsequential compiles might.
Another important part is what kind of virtual hard disk type you choose.
IDE is slowest, but I would be surprised if you used that.
Then comes SATA, it's good for normal use, but not very performant.
Next up is SCSI
Then comes NVMe
Actually there's been some debate between what is fastest.. NVMe or SCSI and I'm not 100% sure. It should be NVMe, but I guess it depends on the guest and a few other factors.
If you want to try.. you have to be aware that Windows needs to install the driver first, before you change or otherwise you might not be able to boot until you switch it back.
One trick is to add a new disk of the type you want to change to. Then boot so that windows installs the driver.. then remove that new disk again and change the disk type of the boot disk.
As always when you start experimenting like this it is always a good idea to have a good backup (or at the very least a snapshot before the experiment)
hope this helps,
--
Wil
Hi wila, wow.. that is a lot of information.
Regarding the CPU usage, my understanding is that the compiler is not multi thread, at least I can't see more than one core firing up when compiling. When reducing from 6 to 4 cores, there was a consistent increase of compiling time of 15sec total, which percentage is not much.
Regarding disk access, I had it already using NVMe, and the same configuration in the others Virtualization Softwares. What I could try to go for is to have it preallocated, but I'm not so sure on that, since the files I'm accessing are in the VM already. I'm not measuring a "copy to the VM" process.
In other hand, I did change the Hard disk buffering from automatic to Enable and tested it. Unfortunately no signficant change was noticed.
1st Run
2nd Run
Is it somehow possible that the VM is not actually using all the capacity of the processor?
As you can see in the pictures above, this kind of project is composed my many small pieces of code and each of them has its own "compiling time" reported. Normally when I run this same project file in a physical windows machine or even when I ran it in the Parallels or Virtual box, the time for each file be compiled was 0-1 sec, but here it takes 2-3 sec. At the end it gives me the total of around 612 sec or 10min12sec.
I'm happy to run as many tests or different configurations as needed, even though it would be easier and cheaper to just go to another solution, but my entire industry field uses VMware and also I rather work with it despite other systems.
Thank you all for your time.
Try looking in windows task manager and monitor CPU, RAM and disk usage - there might be a hint there where the bottleneck is.
This 'feels' like it's more likely to be a file access issue. I presume this is on the internal SSD and not on a Fusion drive or external disk, and that the VM isn't encrypted.
Long shot - is this a fresh, created directly in fusion VM, or was it converted from either another hypervisor or physical machine? It might be worth building a new, clean VM if it was (especially if it was P2V)
Hi dlhotka, thank you for your interest in this matter. Regarding the "long shot" questions, this is were this get interesting. Actually, I did create the VM using VMware Fusion, and only then converted to the others VM Technologies, which had better performance.
The only thing I can thing about is the hypervisor technology implemented by VMWare. It was link Wine and Water when I changed it from apple technology to parallels, reducing from 16 to 4 min. I would guess that something implemented in the WMware Fusion Hypervisor tech is not so optimized. Because, comparing with other technologies, there are no hardware, files access, super hidden trick configuration. I've basically done a automatic conversion and ran the compiling.
Hi,
Blank tips without actual technical details are always tricky as we have to assume certain details.
Like I hope you're not using linked clones or snapshots on your VM?
That you are not running other applications at your host when you time your tests (no browsers open etc..)
Most of these things shouldn't matter, but they might be relevant when you take other things into account.
Also note that the fact that you have other hypervisors installed on your host might actually interfere with your vmware performance tests.
Personally I prefer SCSI on my VMs. here's a few topics on disk speed:
https://communities.vmware.com/t5/VMware-Workstation-Pro/NVMe-disk-vmdk-Slower-than-iSCSI-Where-is-t...
https://communities.vmware.com/t5/VMware-Fusion-Discussions/NVMe-vs-SCSI/td-p/467201
--
Wil
I like to correct myself, I've just read that Fusion 12 running on BigSur uses the Apple Hypervisor Technology.
Hi will,
When running those tests, I did close all the other applications besides VMWare. Otherwise it would not be a valid test. I tried to be as fair as possible, as my intention its not to make one to look better then the other, but to get the best out of the system, as this is my daily activity. As a programmer myself, faster compiling means more valuable for me.
Regarding SCSI, it indeed improved the compiling performance. The time got reduced from 10:15 to 9:23min. That is almost 1 min, so it's undeniable that SCSI drives are better optimized. I've also, after the first test, removed parallels and VB from my system, but no improvement could me noticed.
I'll keep looking for ways to get it better.
Thank you!
Hi,
Are there a lot of screen updates when you compile?
For instance if there's a scrolling list constantly updating and listing all the files it is compiling then there is a chance that repainting the list is taking more time than it should.
As a developer myself I've found various number of times that I could speed up the performance of applications by not providing as much updates to the screen as possible.
Obviously you cannot change that for your compiler.
One thing you might do however is to switch off 3D on the virtual graphics adapter in the VM configuration.
Oh and as you are on Big Sur. In settings -> Advanced there's an option "Disable Side channel mitigations"
Try with both ON as well as OFF.
--
Wil