Richard Mitchell

Software Engineer - Red Gate Software
Engine programmer and factotum.

How many 64bit coders does it take to screw in a lightbulb?

Published Friday, January 19, 2007 8:17 AM

1050 - or thereabouts.

OK I must admit that's not entirely the question, but it is however the answer. As some of you out there know I'm working on the new version of ANTS Profiler (gratuitous link to product, marketing would be so proud) and in the course of my explorations I have of course been using a very simple test app just to sanity check the product as I'm developing it so I don't give the testers a completely broken build.

One of the things this program does is a fairly innocent looking

Consle.WriteLine(1);

Well that shouldn't be too painful and indeed on the 32 bit version of the Profiler it takes a fairly short amount of time. However on the 64 bit profiler it takes a little longer....a lot longer. What can be going on here, why does a simple WriteLine() take so long?

So how many CLR function calls do you think are getting executed for that simple line? 4, 30, 200 - all of these guesses by my colleagues (well the 4 was from somebody who likes Unix too much ;)). No the 64 bit CLR performs around 1050 CLR function calls to do the first WriteLine() and around 80 CLR function calls thereafter.

It's amazing - and that is only the CLR function calls who know how much native stuff is going on under the surface.

Modern computers are amazing that this can all happen in the blink of an eye and I only notice the complexity if I go looking for it.

Oh and the answer to the original question...0x0000000000000001 of course.

Comments

No Comments
You need to sign in to comment on this blog

















<January 2007>
SuMoTuWeThFrSa
31123456
78910111213
14151617181920
21222324252627
28293031123
45678910
Encouraging .NET Reflector Add-ins
 Jason Haley is well-known for the resources he's provided to developers who wish to extend Reflector's... Read more...

Using .NET Reflector Add-ins
 .NET Reflector by itself is great, but it really comes into its own with the help of some add-ins. Here... Read more...

Unique Experiences!
 You'd have thought that a unique constraint was an easy concept - Not a bit of it; it can cause a lot... Read more...

Dynamic Data Templates in ASP.NET 3.5
 Gayani gives an introduction to Dynamic Data Templates in ASP.NET 3.5 and explains how one can save a... Read more...

First Steps with .NET Reflector
 If you are new to using .NET Reflector, or you are wondering whether it would be useful to you, you'll... Read more...