Recent Posts

Tags

News

  • A blog about Microsoft Windows development, focused on kernel-mode driver development, the Windows DDK, WDK, and related tools.

    To elaborate on the copyright notice at the bottom: all content produced by me on this site is copyright and licensed as follows:

    <!-- Creative Commons License --> Creative Commons License
    This work is licensed under a Creative Commons License. <!-- /Creative Commons License --> <!-- <rdf:RDF xmlns="http://web.resource.org/cc/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <Work rdf:about=""> <dc:type rdf:resource="http://purl.org/dc/dcmitype/Text" /> <license rdf:resource="http://creativecommons.org/licenses/by-nc/2.0/" /> </Work> <License rdf:about="http://creativecommons.org/licenses/by-nc/2.0/"> <permits rdf:resource="http://web.resource.org/cc/Reproduction" /> <permits rdf:resource="http://web.resource.org/cc/Distribution" /> <requires rdf:resource="http://web.resource.org/cc/Notice" /> <requires rdf:resource="http://web.resource.org/cc/Attribution" /> <prohibits rdf:resource="http://web.resource.org/cc/CommercialUse" /> <permits rdf:resource="http://web.resource.org/cc/DerivativeWorks" /> </License> </rdf:RDF> -->

    Although I work for Positive Networks, this work is my own and is not connected with my employer in any way.

    <!-- technorati again --> <script type="text/javascript" src="http://embed.technorati.com/embed/8xz8dihr.js"> </script>

Community

Email Notifications

Other Blogs

General

Technical Resources

About Me

Archives

Kernel Mustard

Reflections on Windows System Programming
Steve Dispensa, MVP - Windows DDK

Apple vs. Linux

Why, you ask, is a title such as this present in a Windows kernel-mode blog?

Our good friends at AnandTech have published an interesting article on G5 vs. Opteron vs. Xeon performance. It has one or two major flaws, such as changing two variables at once and attempting to draw a conclusion nonetheless, but it is a fascinating read anyway. The chip architecture stuff is great, although you can also find similarly technical articles at Ars Technica (which I read daily). The really good stuff starts when they do what amounts to an OS comparison between Darwin (the UNIX under MacOSX) and Linux. They point out a really serious performance problem with multi-threaded application performance, and another one with kernel locking.

Locking is really hard. The best seasoned programmers don't always do it right, and the collective wisdom keeps changing and improving as time goes on. NT's internal locking architecture has evolved steadily over the years, just like Linux's has, and (to a lesser degree) MacOSX's. The first iterations of windows had several very hot locks that were practically mandatory in some significant kernel paths, such as I/O (the cancel lock) and dispatching (the dispatcher lock). The current performance of Windows is the result of a systematic effort to profile and improve. Beyond a certain point, it doesn't pay to guess where redesign and recoding will yield improved performance - Raymond Chen has written often about it, and has a recent series on optimization that's worth a read.

The take-home is to profile your code. There are lots of tools available, some expensive and some free, to help you out here. You can even instrument your own code, though that has its own performance-related consequences. Regardless, if you write any nontrivial production code, you owe it to yourself to profile.

Leave a Comment

(required) 

(required) 

(optional)

(required)