how to benchmark amd-v/intel VT performance difference

This is for discussing general topics about how to use VirtualBox.
Post Reply
Muts
Posts: 39
Joined: 20. Jul 2008, 16:55
Contact:

how to benchmark amd-v/intel VT performance difference

Post by Muts »

Does anybody know how I can find out how much of a performance gain I get when I enable/disable the amd-v/intel VT config option?

I myself have an athlon 64 2X 6000+ with amd-v support.

I previously used vmware player for my virtual needs, but since virtualbox has amd-v/intel VT support I changed. I noticed some speedups, but because I only have a bare guest install right now (I will install more at the moments I need it), so I can't really judge the difference just by comparing boot times. :)

I also don't know if it's completely safe to boot my guest install when I change this setting, will the complete hardware-assisted virtualization be fully operation again after I booted the OS once without this support?

All insightfull comments will be greatly appreciated. :D
dependency hell? => /bin/there/done/that
Technologov
Volunteer
Posts: 3342
Joined: 10. May 2007, 16:59
Location: Israel

Post by Technologov »

I will tell you a secret: Hardware virtualization does not improve performance. It does improve stability and easy of development for virtualizers, however.

-Technologov
Muts
Posts: 39
Joined: 20. Jul 2008, 16:55
Contact:

Post by Muts »

Well, that's odd.

When I boot win xp in vmware player, the boot time is always pretty slow, even if I shut it down and boot it again (without rebooting the host).

But when I do the same procedure with win xp in virtualbox (with amd-v enabled), the second time the boot sequence is near-instant (compared with the first boot and booting in vmware).

The xp install in vmware has more software on it, though.

(There are a lot of personal things way superior with virtualbox, so I'm not changing back anyway. :))
dependency hell? => /bin/there/done/that
Technologov
Volunteer
Posts: 3342
Joined: 10. May 2007, 16:59
Location: Israel

Post by Technologov »

You are speaking about 2 products: VMware and VirtualBox.

Did you know that both VMware and VirtualBox can have VT enabled (Hardware Virtualization) or disabled (Software virtualization) ?

If you wanna be professional, then compare:
-VMware with VT
-VMware without VT
-VirtualBox with VT
-VirtualBox without VT

-Technologov
TerryE
Volunteer
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
Contact:

Post by TerryE »

This area is a complex subject and maybe one for a tutorial. The basic x86-IA32 instruction set has 17 opcodes which are not properly virtualised, simply because the designers forgot that when they first laid out the architecture for their 20MHz 386s with 1Mb RAM that with Moore's Law in a decade or so you'd have Joe Blow user running a 4x3GHz 786 with 4Gb RAM wanting to run virtual machines. There are two approaches to achieving true virtualisation within the Popek and Goldberg criteria:
  • The first is to treat the binary code as a mailable entity and modify it on the fly to remove nasty inconveniences. VMware and VBox adopt slightly different strategies here: VMware uses JiT binary translation and VBox uses code scanning and patching but in reality they work and perform "much of a muchness". "User code" pretty much runs flat out, but any Ring 0 code which touches the H/W ends up being interpreted at a 10x or worse slowdown. The blend can be typically between 70-95% of throughput depending on the application mix.
  • The second is that first AMD then Intel decided to add an extra layer in the microcode to provide proper virtualisation support (the so called VT-x option), and this is included in the latest x64 chipsets.
The first of these is a mature and tuned technology. It is also extremely complex to do, the second is less mature and a lot simpler for the VM writers to implement. So today as Technologov says they perform about equally but with each iteration of silicon, H/W virtualisation is rapidly overhauling S/W (The overhead in the latest core 2 designs in about one third of what it was in the first version in terms of clock cycles for trapping and despatching a "naughty" instruction.)

What these two approaches do is to allow you to run on OS unchanged against a specific virtualised machine, and as long as you can live with the constraints of that virtualised H/W and the run time implications, then this gives you the easiest and most robust install. It can also give you terrible perceived performance on near-realtime devices such as the mouse and audio. So what both VMware and VBox do is to add para-virtualisation techniques by adding installable VM-aware device drivers which are written to avoid the virtual H/W but instead call the host VMM directly though some guest-to-host connector.

It's in this area that the real performance differences come out, that is if you have VBox Guest Additions (or VMware tools) installed on your client. VMware has good network and block (HDD) drivers which bypass the VMM overhead. VBox uses native I/O virtualisation for both these.
VBox has more efficient mouse and graphics drivers than VMware, at least for basic windowing work. However, the virtual Graphics Adapter that VMware emulates is functionally richer and has better 2D pass-through, so woks better on video apps etc. Neither have any working 3D capability, though the VMware driver does implement very limited 3D functionality.
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
Muts
Posts: 39
Joined: 20. Jul 2008, 16:55
Contact:

Post by Muts »

Technologov wrote:You are speaking about 2 products: VMware and VirtualBox.

Did you know that both VMware and VirtualBox can have VT enabled (Hardware Virtualization) or disabled (Software virtualization) ?
I was fully aware I was comparing these two different products, but were you aware that vmware player (which I used) does not support HW virtualization, but virtualbox does? The things I said are just the experiences I have.

TerryE, thanks a lot for that interesting info.

I was already aware how virtual machines work, with trapping instructions that need to be 'decoded' and the system they use for drivers and client/host additions. I simply was wondering if there was a significant benefit from using my amd-v ability, compared to disabling this.

I find it strange that there seems to be so little info about this very subject, and would like to know if I can measure the difference myself if I need to.
dependency hell? => /bin/there/done/that
kebabbert
Volunteer
Posts: 321
Joined: 31. May 2008, 10:00
Primary OS: OpenSolaris 11
VBox Version: OSE other
Guest OSses: WinXP, RedHat, Ubuntu

Post by kebabbert »

Here is some blog post about speed benchmarks with and without hardware extension

http://www.itwriting.com/blog/660-virtu ... my-pc.html
Muts
Posts: 39
Joined: 20. Jul 2008, 16:55
Contact:

Post by Muts »

That page mentions (with his setup and tests) that the system was slower with hardware virtualization. :shock:

For a little test, I did a boot and shutdown without amd-v support. The boot was a lot slower, I could even see the grey/white tiny loading bar that appears briefly before the standard black loading screen with the XP logo etc. (This loading bar is mostly only seen on slow pc's.) If I really wanted to do a good boot comparison (while counting the time it takes), I would have to reboot my host also, which I don't really like to do without good reasons. If I don't reboot like that, a lot of libraries will still be in memory so the result wil be skewed. Being lazy also does not help. :P

The page you mentioned explains that virtualbox has superior hard drive speed/throughput, and this is exacly what happens during that loading bar I describe.

This is only a very limited test, but it seems that enabling amd-v is an important improvement on my system. :)
dependency hell? => /bin/there/done/that
TerryE
Volunteer
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
Contact:

Post by TerryE »

Sorry if I was "teaching Grandmother to suck eggs" but I write these responses as much for the general reader who picks the post up, and they might not have your background. VMware are pretty responsible about being the market leader here and produce some good whitepapers. Understanding Full Virtualization, Paravirtualization, and Hardware Assist. AnandTech gives some timing comparisons in Hardware Virtualization: the Nuts and Bolts which show that the 2008 Xeons benchmark nearly 4-6x faster than the 2004 Xeons in terms of Virtualization overhead. AMD have make comparable improvements in the Phenom.

And VT-x based systems should be a lot more stable, so in the medium term I see JiT binary translation and patching becoming an obsolescent technology.
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
Post Reply