Alex Rivera | Logout

Windows Safe Mode runs simple programs (at least) 3 times faster?

Asked 2010-11-20T21:37:33.410
13

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. :(

Edit
Report

1 Answer

2

A few points:

  • You say you measured the time using a stop watch, that's not going to give you the real time spent on your process, you need to profile the code properly
  • Have you tried any other programs?
  • Give this test a shot, two XP VM's, one VM starts in Safe Mode and one in normal mode, start the program in both VM's around the same time and measure the cpu time each one takes (not the clock time)
answered 2010-11-20T22:09:37.480

Your Answer