Increase speed for console app on WinXP x64 with Pentium D

HI after succesfully compiling my 32bit single thread console program for the use on x64, I realize that the processor(s) are each just 50 occupied with my program.
On a single core machine the processor is 100% occupied with my program and execution is faster.
Since I only have the /MT (multithread) compiler option for the PSDK amd64 bit compiler, I assume that my program is executed as multithread.

and since one processor has to wait for results from the other one, the entire processing time goes up.

Is there a way of making just one of the cores deal with my program
How can I speed it up

any help is appreciated

thanks alot
Maik



Answer this question

Increase speed for console app on WinXP x64 with Pentium D

  • CLPMAN

    SetProcessAffinityMask

    is one way if you are doing the source compile.  If it's an already-made exe, there's an app that'll patch the PE header and make it do the same.  Look for

     IMAGECFG.exe

    It's on the NT4 install CD, in the i386/debug directory (as I remember).  It's also in (maybe) the win2000 reskit SUPPLEMENT ONE package (good luck finding that if you don't already have it).

    C:\>imagecfg
    usage: IMAGECFG [switches] image-names...
                  [- ] display this message
                  [-s path to symbol files]
                  [-v MajorVersion.MinorVersion]
                  [-w Win32 GetVersion return value in hex]
                  [-a Process Affinity mask value in hex]
                  [-u Marks image as uniprocessor only]
                  [-r run with restricted working set]
                  [-b BuildNumber]
                  [-g bitsToClear bitsToSet]
                  [-o default critical section timeout
                  [-d decommit thresholds]
                  [-m maximum allocation size]
                  [-t VirtualAlloc threshold]
                  [-p process heap flags]

    C:\>where imagecfg.exe
    c:\program files\tools\imagecfg.exe

    C:\>dir "c:\program files\tools\imagecfg.exe
     Directory of c:\program files\tools

    96 11 18  03:38            51,472 IMAGECFG.EXE
                   1 File(s)         51,472 bytes


    It's great for games which cache-thrash, or run slower for whatever reason, when let to roam freely.  I haven't checked it on a 64-bit PE header.


  • Brijesh Kumar

    I don't believe there is a way of doing that.

    BTW, I would suggest using VC2005 where lots of the new optmizations are enabled through the new compiler (for 32bit as well as 64bit).

    Thanks,
      Ayman Shoukry
      VC++ Team

  • Increase speed for console app on WinXP x64 with Pentium D