While doing a lot of benchmarking stuff these days, I stumbled upon something very disturbing / interesting / new to me. After doing some research getting more and more to the point (which i couldnt believe), it seems that windows xp (and probably all other versions as well) runs programs around 3 times as slow as in safe mode.
Take this small program as an example:
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv)
{
long i,j,k;
printf ("Starting...\n");
k = 12;
for (i = 0; i < 20000; i++)
for (j = 100000; j > 0; j--)
k = k * 12;
printf ("Done... k =%d", k); // just using k here to prevent the whole block isn't optimized away.
return 0;
}
On my 2.4 Ghz computer it takes ~ 2.5 secs to execute in safe mode, while it takes ~ 8 secs to execute in normal mode. (ThreadPriority = TIMECRITICAL, ProcessClass = REALTIME).
EVEN when i compile and start that code within a vmware-linux session under this very windows normal mode it executes faster (around 5.5 secs).
I also did a lot of cpu cycle measuring and actually the results from safe mode seem much
more like what you should expect given the amount of instructions processed.
So what did i miss ? Can anybody riddle me this ?
All pointers and hints appreciated,
Thanx.
SOLVED! I am sorry guys, this issue is related to my crappy alienware m15x which for some reason is throttling down to apparently 1/3 of its cpu power – unless you use evil tools (ThrottleStop.exe) to bring it up to normal speed. Devastatingly sorry for wasting your time. 🙁
Fairly sure that this is something special with your computers.
I ran that code, compiled with MSVC 10 in Release mode, on an old XP netbook and it’s a little faster in normal mode than in safe mode for me, not measuring very carefully, but it took about 8 seconds in normal mode and 10 seconds in safe mode.
A bit surprising also that it seems to take as long on your computer in normal mode as on an old single core Atom CPU. You don’t mention what computer it is, but I’m assuming that it’s supposed to be faster than a netbook so you might have an issue with it.