{"id":2433,"date":"2007-01-19T02:17:00","date_gmt":"2007-01-19T02:17:00","guid":{"rendered":"https:\/\/test.simple-talk.com\/uncategorized\/how-many-64bit-coders-does-it-take-to-screw-in-a-lightbulb\/"},"modified":"2016-07-28T10:49:00","modified_gmt":"2016-07-28T10:49:00","slug":"how-many-64bit-coders-does-it-take-to-screw-in-a-lightbulb","status":"publish","type":"post","link":"https:\/\/www.red-gate.com\/simple-talk\/blogs\/how-many-64bit-coders-does-it-take-to-screw-in-a-lightbulb\/","title":{"rendered":"How many 64bit coders does it take to screw in a lightbulb?"},"content":{"rendered":"<p>1050 &#8211; or thereabouts.<\/p>\n<p>OK I must admit that&#8217;s not entirely the question, but it is however the answer. As some of you out there know I&#8217;m working on the new version of <a href=\"http:\/\/www.red-gate.com\/products\/ants_profiler\/index.htm\">ANTS Profiler<\/a> (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&#8217;m developing it so I don&#8217;t give the testers a completely broken build.<\/p>\n<p>One of the things this program does is a fairly innocent looking<\/p>\n<p><code>Consle.WriteLine(1);<br \/><\/code><br \/>Well that shouldn&#8217;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&#8230;.a lot longer. What can be going on here, why does a simple <code>WriteLine()<\/code> take so long?<\/p>\n<p>So how many CLR function calls do you think are getting executed for that simple line? 4, 30, 200 &#8211; 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 <code>WriteLine()<\/code> and around 80 CLR function calls thereafter.<\/p>\n<p>It&#8217;s amazing &#8211; and that is only the CLR function calls who know how much native stuff is going on under the surface.<\/p>\n<p>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.<\/p>\n<p>Oh and the answer to the original question&#8230;<code>0x0000000000000001<\/code> of course.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1050 &#8211; or thereabouts. OK I must admit that&#8217;s not entirely the question, but it is however the answer. As some of you out there know I&#8217;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&#8230;&hellip;<\/p>\n","protected":false},"author":167198,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[2],"tags":[],"coauthors":[],"class_list":["post-2433","post","type-post","status-publish","format-standard","hentry","category-blogs"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/2433","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/users\/167198"}],"replies":[{"embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/comments?post=2433"}],"version-history":[{"count":1,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/2433\/revisions"}],"predecessor-version":[{"id":24402,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/2433\/revisions\/24402"}],"wp:attachment":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/media?parent=2433"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/categories?post=2433"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/tags?post=2433"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/coauthors?post=2433"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}