Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / October 2007

Tip: Looking for answers? Try searching our database.

Windows 2003 Server vs Windows XP

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Eddie - 08 Oct 2007 10:14 GMT
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
Carl Daniel [VC++ MVP] - 08 Oct 2007 15:26 GMT
> 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
[quoted text clipped - 27 lines]
> 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
Sheng Jiang[MVP] - 08 Oct 2007 19:53 GMT
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.

Signature

Sheng Jiang
Microsoft MVP in VC++

> 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
[quoted text clipped - 28 lines]
>
> Eddie
Eddie - 09 Oct 2007 08:29 GMT
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

> 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.
Sheng Jiang[MVP] - 17 Oct 2007 23:24 GMT
Microsoft Windows Internals 4th. ed. page 49

Signature

Sheng Jiang
Microsoft MVP in VC++

> 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?)
[quoted text clipped - 4 lines]
> > versions of windows have strategies to allocate memory blocks and schedule
> > processes to shorten response time for all processes.
Eddie - 11 Oct 2007 12:41 GMT
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
Ben Voigt [C++ MVP] - 11 Oct 2007 17:20 GMT
> 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?

> Eddie
Eddie - 12 Oct 2007 08:54 GMT
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

> 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
[quoted text clipped - 28 lines]
>  
> Eddie

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.