Sunday, April 30, 2006

When Your Need Is Speed

Came across a recent article form MSDN magazine (The Performance Benefits of NGen.). I have been really intersted in these CLR nitty gritty's, and Ngen is one of my favourite discussions with my CLR crazy freinds.

Typically the methods in managed executables are JIT (Just in time) compiled.The machine code generated by the JIT compiler is thrown away once the process running that executable exits; therefore, the method must be recompiled when the application is run again. Moreover, the generated code is tied to the process that created it and cannot be shared between processes that are running the same application. This can be a performance drawback.

But When Your Need Is Speed Ngen can be the answer.NGen refers to the process of precompiling Microsoft intermediate language (MSIL) executables into machine code prior to execution time. This results in two primary performance benefits. First, it reduces application startup time by avoiding the need to compile code at run time. Second, it improves memory usage by allowing for code pages to be shared across multiple processes.

Mind you, ngen is not jsut another traditional static back-end compilation tool.Unlike statically compiled binaries, NGen images are tied to the machine where they are created and hence cannot be deployed. Instead, the application's installer needs to issue commands to create native images for the specific assemblies on the client machine at setup time. Also unlike traditional binaries, NGen images merely form a cache-managed applications will continue to run correctly even if all the NGen images are deleted. Of course, there will be a performance hit if that happens, but there will be no correctness issues.

NGen typically improves the warm startup time of applications, and sometimes the cold startup time as well. Cold startup time is primarily dominated by the number of pages that need to be fetched from disk. The improvement in cold startup time while using NGen can be attributed largely to the fact that pages of MSIL that need to be touched during compilation no longer need to be accessed at execution time.

Improvements in warm startup time come from reusing pages of the NGen images that were brought in when the application had been running earlier. This is especially beneficial to large client-side UI applications where startup time is critical to the user experience.

NGen also improves the overall memory usage of the system by allowing different processes that use the same assembly to share the corresponding NGen image among them. This can be very useful in both client and server scenarios in which the total memory footprint must be minimized.

Wednesday, April 26, 2006

Cool Designer event in London

For all of my design programming friends Ben, Ioulieta, Chang and all others who are currently working on designing. This is a really good one. Check it out


  • Cool Designer event in London
  • Monday, April 24, 2006

    Team Foundation Server continued...

    Team Foundation Server:

    As promised my research into Team Foundation Server has continued and here I am with some information (censored. I had to remove the part I prepared as part of my report to my Manager)

    A Microsoft official at the VSLive! Conference said Visual Studio 2005 Team Foundation Server represents a shift from a developer-centric focus in building software to a collaborative one. As much as I have read and explored about it, this seems to be correct.

    Team Foundation Server works with the company’s Visual Studio 2005 Team System platform to enable collaboration between multiple roles -- such as project managers, architects and developers -- in the development process.
    One of the things I was concerned about was the Team Foundation Internationalization.
    The text below I got from Aldo Donetti Blog
    Most of you know that Visual Studio is currently localized into 9 languages (English, Japanese, Korean, Simplified and Traditional Chinese, French, German, Spanish, Italian). Team Foundation will be localized in the same languages, but it has not been designed to be multilingual in its first release, therefore system administrators will have to select one language for the server.

    In a distributed/multilingual organization it might not be uncommon to have users installing Visual Studio in their favourite language. Most of the User Interface is stored on the client, but not all of it. A number of error messages come from the server and will show up in the language of the Team Foundation Server installed. Or else, in case of server exceptions, the call stack is provided by the .NET Framework in whatever language it was installed on the server and this would be pushed to the client, though we always wrap exceptions in a user friendly way. It’s easy to understand why a fully localized experience will be achieved only if both the Team Foundation server language and the Visual Studio client language match.


    Setting up your server to support international data

    Most of the international issues you might have to deal with can be avoided by properly installing and configuring SQL Server on the Team Foundation server. Because some of these changes are hard to undo, you should plan the usage scenarios of your Team Foundation server in advance.

    You should at least take into consideration the natural language your teams will be using and set the collation accordingly, because it will obviously affect sorting. Based on the language you plan to use, you might also want to appropriately set switches to allow Case, Accent, Kana and Width sensitiveness (see screenshots below). We highly recommend using a case insensitive collation. Also, should you wish to extensively use Extended Unicode characters (Surrogates), we recommend using one of the “_90” collations. Please see the SQL Reference manual to understand what option is best for you.

    Sunday, April 23, 2006

    Hu understands the thoughts of chairman Bill

    You got ot read this. I got this from google news feed (The Observer). This is hillarious.

    John Naughton
    Sunday April 23, 2006
    The Observer


    When President Hu Jintao of China arrived in the US last Wednesday, his first appointment was dinner with Bill Gates, co-founder and chairman of Microsoft, at Gates's mansion (aka San Simeon North) on the shores of Lake Washington. They dined on smoked guinea fowl, which had been shot at by the US Vice-President, Dick Cheney. (He missed, and hit one of his friends instead; the guinea fowl was later killed by humane means.) The pair were joined by Steve Ballmer, CEO of Microsoft, the Chinese ambassador to the US, a number of the President's aides and the deputy assistant head of protocol at the White House. Owing to an unpatched security hole in Gates's Windows-powered home-monitoring system, the meeting of the two Great Leaders was bugged and a transcript of their conversation has been obtained by The Observer ...
    Gates: You Hu?

    Hu: I am the President of China.

    Gates: Cool. I'm the Chairman of Microsoft. (Hu bows.)

    Hu: Because you, Mr Bill Gates, are a friend of China, I am a friend of Microsoft.

    Gates: Wow! That's really cool. We're very interested in China, you know. Big market. Smart people.

    Hu: We are pleased that many great US companies are coming to China - for example Google.

    Ballmer: (Heatedly) Those sons of bitches. They stole one of our top Chinese execs ...

    Gates: Cool it, Steve. Hu doesn't know about that.

    Hu: We also have Yahoo in China. They are very co-operative in rooting out undesirable elements.

    Ballmer: (Mutters.) Maybe they could help root out Google ...

    Hu: We like Google very much. They are most understanding of our needs. Chinese people do not want to know about freedom and democracy. They just want to know where to buy BMW cars and plasma TVs and such things.

    Gates: Now that you're here, Hu, I gotta problem I'd like to share with you.

    Hu: I will be honoured to help you, Mr Bill Gates. What is your problem? Or, as your Harvard Business School says, should I call it an 'opportoonity'?

    Gates: Eh? Oh, I see. Well it sure looks like a problem to me. You see you have a lot of PCs in China ...

    Hu: (Proudly) Yes, we have already 500 million PCs...

    Gates: ... and they're mostly running Windows XP.

    Hu: (Beaming). Certainly. The latest version with Service Pack 2 installed. We are becoming a most leading-edge economy. Also they have Office Productivity Suite including PowerPoint. It is a most excellent situation. What is your problem, Mr Bill?

    Gates: The problem is that, as far as we can see - and Steve here has looked at the figures - we only sold 153 Windows XP and 25 Office licences in the whole of China last year. Those damn PCs are all running bootleg - pirated - software and we haven't made a dime in licence fees on any of them. This is not good, Hu, not good at all ...

    Ballmer: Too damn right ... And it all happens because your factories are shipping cheap PCs with blank hard drives and no pre-installed operating system. Then those lousy schmucks install ripped-off versions of our software on them.

    (At this point, a Chinese official whispers in the President's ear. After a few moments, Hu turns back to Gates.)

    Hu: (Gravely). I see why you are distressed, Mr Bill. And because China wishes to be friends with Microsoft, your distress also distresses me. But my officials tell me that we have solved the problem.

    Gates: Cool. How?

    Hu: Chinese factories will no longer turn out these - how you say? - naked PCs. All will come with operating system pre-installed.

    Gates: Great stuff! Which version? Windows 2000 or XP? And don't forget Vista - we'll be shipping that soon.

    Hu: No. Red Flag Linux. Made in China.

    (At this point, Ballmer screams, picks up a chair and hurls it at the $250,000 video-wall in Gates's dining room, shattering screens and shorting the lights.)

    Gates: That's the dumbest idea I've ever heard, Hu.

    Hu: I do not understand, Mr Bill. First you tell me that you don't like these PCs with no operating system, and then you say you don't like them with operating system. I am confused.

    Gates: The thing is, Hu, that Linux system is bad news.

    Ballmer: You said it, buddy. Spawn of the devil.

    Hu: What is wrong with it?

    Gates: Well, for starters, it's a system put together by a bunch of hippies.

    Ballmer: It's like, totally un-American.

    Hu: Does that mean it doesn't work?

    Gates: No, it works fine. Better than that goddam pre-release version of Vista, in fact.

    Hu: So why do you dislike it so much, Mr Bill?

    Gates: Well, those damn hippies just give it away.

    Ballmer: It's basically, well, communistic.

    Hu: (Shocked) Ah, now I see. We are totally opposed to communism too, Mr Bill. How much will you charge for 500 million Vista licences?

    Saturday, April 22, 2006

    Talking about Software Engineers are #1

    One of my current best sites for career and jobs is the JobSyntax site. It is a new company started by our very own Zoƫ Goldring and Gretchen Ledgard.

    Here is a quote below from their latest blog entry. Really informative

  • Software Engineers are #1
  • Wednesday, April 19, 2006

    Team Foundation Server

    the project i am working at my job is planning to shift to Team Foundation Server. Thus i am looking for the most common questions related to it.
    Here are a couple of them.

    Is it a good idea to use the same machine as "build machine" and "team foundation server"?

    It is not a good idea to make Team Foundation Server machine as build machine for real life deployment (ok for demos/trials etc). The main reason is for debugging build failures etc, many people in org may need access to build machine and that could pose a security threat to the server.


    Where all do I need to install the fxcop tool (that came with the VSTS for developer DVD) to enable static analysis in Team Build?

    Only build machine.

    Over the next few weeks i will collect some more questions and post them on my blog, so as to createa sort of repository for common questions related to Team Foundation Server.

    Monday, April 10, 2006

    Software as a Service

    I believe that Software as a Service (SaaS) is the future of the ever expanding software industry. The Software as a Service (SaaS) model differs fundamentally from traditional enterprise application delivery. To successfully provide SaaS to end users, software companies must evaluate nearly every facet of their business: pricing, billing, sales compensation, revenue recognition, code, infrastructure, end user support, and more.
    The end users are demanding it and competitors are already providing it, but how do software companies overcome the model, code, and operational issues preventing them from bringing SaaS to market?
    One succesfull example is IBM. IBM's Software as Services Showcase provides an online directory that allows customers to search for IBM Business Partner solutions that are available to them as a service. The Showcase includes solutions that span a range of industries, such as retail and insurance, and solution areas, such as compliance and human resources.

    Sunday, April 09, 2006

    Rotor 2.0

    As part of my University Masters degree, i used Shared Source CLI aka Rotor. I was so fascinated by it, that it has become my favourite area to explore whenever i have time from my busy work schedule. Take a look at the fetures highlighted below.

    Features
    The Shared Source CLI archive contains the following technologies in source code form:
    An implementation of the runtime for the Common Language Infrastructure (ECMA-335).
    Compilers that work with the Shared Source CLI for C# (ECMA-334) and JScript.
    Development tools for working with the Shared Source CLI such as assembler/disassemblers (ilasm, ildasm), a debugger (cordbg), metadata introspection (metainfo), and other utilities.
    The Platform Adaptation Layer (PAL) used to port the Shared Source CLI from Windows XP to other platforms.
    Build environment tools (nmake, build, and others).
    Test suites used to verify the implementation.
    A rich set of sample code and tools for working with the Shared Source CLI.

    Now, Rotor 2.0 is out there and is available for download here!(http://www.microsoft.com/downloads/details.aspx?FamilyId=8C09FD61-3F26-4555-AE17-3121B4F51D4D&displaylang=en)
    Now, when we are writing your CLR 2.0 application, and want to debug into the BCL, we can.


    New in this Release

    Full support for Generics.
    New C# 2.0 features like Anonymous Methods, Anonymous Delegates and Generics
    BCL additions.
    Lightweight Code Generation (LCG).
    Stub-based dispatch.
    Numerous bug fixes.