Page 1 of 1

Improved performance of Win 8.1

Posted: 16. Apr 2014, 04:54
by Mal
This may be well known, but I wasn't able to find it out very easily, so I'm sharing it for general knowledge....
I recently upgraded 2 vm's from Win XP 32 bit (with 3Gb ram) to Win 8.1 64 bit (with 4Gb ram). Ever since, there's been a noticeable loss of performance, things just take much longer, launching programs, browsing internet etc. After doing some digging and trying several things I came across a suggestion that reducing the number of cpu's would help. I had configured both vm's to have 4 vcpu's, as XP had had, (since more cpu's is usually better in the physical world). The host is an I7 with 16Gb ram running Win 7 64 and has 4 physical 8 logical cpu's. Anyway, I reduced the number of vcpu's to 1 and immediately everything speeded up. Booting takes a fraction of the time and the systems are just generally much snappier. To me this is fairly counter-intuitive, but the argument seems to be that if you give the vm 4 cpus, it must wait for 4 to be available before being able to do anything, which takes longer to achieve. where-as with only 1 cpu, it's more likely to be able to grab one straight away. I don't know why this didn't affect XP, but I suppose windows 8 is much cleverer and will try and use as much as it's got.
Anyway, I'd suggest giving it a try: just take a snapshot first.

Re: Improved performance of Win 8.1

Posted: 16. Apr 2014, 06:08
by loukingjr
You might also want to reduce the memory in the two 32bit XP vm's to 2GB. I don't see much benefit to a 3GB XP guest. You seem to be getting cores and cpus and threads mixed up. An i7 is one CPU that has 4 cores and 8 threads so a guest should never be set to more than 2 cores. One core does seem to work best on Mac hosts,. I wouldn't know about Windows or Linux hosts.

I should point out that having multi-core processors is only a benefit if the OS and the software running on it knows what to do with it.

Re: Improved performance of Win 8.1

Posted: 16. Apr 2014, 15:06
by mpack
Mal wrote:(since more cpu's is usually better in the physical world)
Aha, a victim of marketing.

In fact it isn't true that more CPUs necessarily help in the physical world. Do you also think that adding 2, 3 or more engines is bound to make your car go faster?

Most applications are not designed to take advantage of concurrent processing - everything is done in linear steps because it's easier to design that way, and because it will work on all PCs instead of just the high end ones. Also, most applications are not bounded by CPU, they're bounded by disk speed, user keyboard and mouse interaction etc. Even many applications that you might think of as CPU bound - video rendering say - are often accelerated using other hardware such as a GPU.

I'd concede that almost every PC benefits from having two cores. That means that the OS can be using one core for mundane background tasks while barely affecting the foreground application. Beyond two cores... it's rare to see any benefit IMHO. Ok, true, if you habitually run multiple CPU (but not I/O) intensive applications in parallel then more cores will help, but I suspect most people do not do that. Also, if you run one CPU intensive task that has been specially written to do lots of things in parallel (weather system modelling for example), then the additional CPU cores will help. Again, I suspect that's a niche requirement.

The reason that CPUs today are having lots of cores added is that a few years back they started running into fundamental problems making a single core go faster: light speed limits on signal propagation, overheating, high power consumption etc. More cores is a way of selling more (implied) performance to the unwary, even when it can't really be delivered.

Re: Improved performance of Win 8.1

Posted: 16. Apr 2014, 15:10
by mpack
And so, to the effect on VirtualBox: consider that supporting N cores (N>1) in a VM must involve extra costs, e.g. 2 cores requires twice as many registers to be saved on a host/VM/VM context switch. If those costs aren't being outweighed by benefits (and as I argue above, most will not benefit), then adding cores will just make the VM go slower.