Windows 2003 Server vs Windows XP

G

Guest

We have an odd situation with some of our single-threaded CPU-bound C++
programs. They run between 2 and 4 times faster on Windows XP than on windows
Server 2003 on the same Xeon hyperthreading dual processor machine (we
borrowed one from our IT department, and have been alternating these two
operating systems on it.)

Even more odd, if we run a Virtual PC with Windows XP on top of the Windows
2003 Server on the same Xeon machine, the programs run faster too. There is
nothing else running on the machine during these tests, both underlying
operating systems show the expected 25% CPU usage.

I've changed the Windows 2003 Server system properties to give the best
performance for programs as opposed to background work, but this made no
difference.

Next I tried running the programs on my Core 2 Duo with Windows XP, and
comparing this with a Virtual PC running Windows 2003 Server on top of
Windows XP on my machine. The programs showed negligible difference in
run-times, and the expected 50% CPU usage.

We think, but are not sure, that the slowing down on 'native' Windows 2003
Server is something to do with memory cache misses. This seems to be the only
thing our profiling tool (AQTime) shows to be substantially different when we
run our programs.

Does anybody have a similar experience? Is this a 'known fact'? Is there
anything we can do to our programs to make them run faster on Windows 2003
Server? I'm not sure I'm asking the right forum, if I'm not where would be
better? We need to move the programs to a Windows 2003 Server production
environment but are very disappointed with the throughput.

Eddie
 
C

Carl Daniel [VC++ MVP]

Eddie said:
We have an odd situation with some of our single-threaded CPU-bound
C++ programs. They run between 2 and 4 times faster on Windows XP
than on windows Server 2003 on the same Xeon hyperthreading dual
processor machine (we borrowed one from our IT department, and have
been alternating these two operating systems on it.)

Even more odd, if we run a Virtual PC with Windows XP on top of the
Windows 2003 Server on the same Xeon machine, the programs run faster
too. There is nothing else running on the machine during these tests,
both underlying operating systems show the expected 25% CPU usage.

I've changed the Windows 2003 Server system properties to give the
best performance for programs as opposed to background work, but this
made no difference.

Next I tried running the programs on my Core 2 Duo with Windows XP,
and comparing this with a Virtual PC running Windows 2003 Server on
top of Windows XP on my machine. The programs showed negligible
difference in run-times, and the expected 50% CPU usage.

We think, but are not sure, that the slowing down on 'native' Windows
2003 Server is something to do with memory cache misses. This seems
to be the only thing our profiling tool (AQTime) shows to be
substantially different when we run our programs.

Does anybody have a similar experience? Is this a 'known fact'? Is
there anything we can do to our programs to make them run faster on
Windows 2003 Server? I'm not sure I'm asking the right forum, if I'm
not where would be better? We need to move the programs to a Windows
2003 Server production environment but are very disappointed with the
throughput.

That is a very odd problem, and not consistent with results I've seen (where
I've always seen nearly identical performance).

You might try asking in microsoft.public.win32.programmer.kernel, however.

-cd
 
S

Sheng Jiang[MVP]

This has nothing to do with the Visual C++ language. Though I heard server
versions of windows have strategies to allocate memory blocks and schedule
processes to shorten response time for all processes.
 
G

Guest

Thanks Sheng, that is very useful. Do you know where I might be able to find
out more about this? (Web-site, book, published paper?)

Eddie
 
G

Guest

Problem solved! It was a file mapping option that caused them to slow down.
The programs now run marginally faster on Windows 2003 Server. Phew.

Eddie
 
B

Ben Voigt [C++ MVP]

Eddie said:
Problem solved! It was a file mapping option that caused them to slow
down.
The programs now run marginally faster on Windows 2003 Server. Phew.

Mind sharing which flag/option?
 
G

Guest

I'll explain the fix in more detail - and how the situation occurred. I hope
this will help others if they see a similar problem.

The code we use for file mapping in a suite of programs was written some
years ago, at that time the MSDN library suggested that the EC_NOCACHE flag
in "CreateFileMapping" could be beneficial - and indeed it showed a modest
increase in run-times for some of our programs on Windows XP (about 5%, which
is good when some of these programs take a few days to complete).

We recently tried some of these programs on Windows 2003 Server and the
results were bad, as I mentioned earlier. Of course we had completely
forgotten about this option; the number of lines of code in these programs is
very large.

The latest MSDN library does not recommend using the flag, except where
essential. We removed it in one program, and Windows 2003 Server now runs
this program somewhat faster than Windows XP. The run-time on XP has slowed
down a little, as already explained. We are now investigating the use of this
option on Vista, XP, 2003 Server and 2000 Server as well as with all the
other programs we have.

Eddie
 
S

Sheng Jiang[MVP]

Microsoft Windows Internals 4th. ed. page 49

--
Sheng Jiang
Microsoft MVP in VC++
Eddie said:
Thanks Sheng, that is very useful. Do you know where I might be able to find
out more about this? (Web-site, book, published paper?)

Eddie
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top