<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>GrantRi's WebLog [MS] : 64-Bit</title><link>http://blogs.msdn.com/grantri/archive/tags/64-Bit/default.aspx</link><description>Tags: 64-Bit</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>More on 64-vs-32</title><link>http://blogs.msdn.com/grantri/archive/2005/01/27/361852.aspx</link><pubDate>Thu, 27 Jan 2005 20:24:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:361852</guid><dc:creator>grantri</dc:creator><slash:comments>5</slash:comments><comments>http://blogs.msdn.com/grantri/comments/361852.aspx</comments><wfw:commentRss>http://blogs.msdn.com/grantri/commentrss.aspx?PostID=361852</wfw:commentRss><wfw:comment>http://blogs.msdn.com/grantri/rsscomments.aspx?PostID=361852</wfw:comment><description>&lt;p&gt;OK, this isn't a really meaty post, it's more of a collection of a few ideas that have been rattling around in my head for a while.&amp;nbsp; I kept hoping they'd develop into something bigger, or I'd have time to research/investigate them more, but nothings happened, so I'll just dump them as is.&lt;/p&gt; &lt;p&gt;So when comparing AMD64 chips to normal x86 chips, there's two broad categories of differences:&lt;/p&gt; &lt;ol&gt; &lt;li&gt;Registers and Pointers are now twice as big.&lt;/li&gt; &lt;li&gt;Killer architecture that helps even x86 code run faster.&lt;/li&gt;&lt;/ol&gt; &lt;p&gt;Most gamers out there are already aware of #2, so instead I'm going to focus on #1.&amp;nbsp; Basically I think of it this way, "I've already got this screaming system and I need to decide if it's worth it to compile my code for 64-bit or leave it as 32-bit."&amp;nbsp; There is pain involved in moving to 64-bit unless you happen to be the perfect developer that carefully uses size_t and HANDLE and int religiously.&lt;/p&gt; &lt;p&gt;The biggest downside I've run into lately (and this really isn't new researchers ran into it almost 20 years ago on the first 64-bit RISC chips) also happens to be the biggest benefit of 64-bit: pointers are now twice as big!&amp;nbsp; If you have a classic tree structure that contains relatively trivial data, it has suddenly doubled in size.&amp;nbsp; Now if you really have a tree that holds enough data that it exceeds 2GB, then this probably is OK because you need that much address space.&amp;nbsp; Most apps don't fall into that category (and for the rest of this post I'm going to assume that the normal 32-bit 2GB of addressable memory is sufficient).&amp;nbsp; Thus I think my first criteria is simple: are your data structures pointer-laden?&amp;nbsp; If they are, you are going to take a hit in performance from increased memory usage.&lt;/p&gt; &lt;p&gt;The 'fix' is to change your data structures to use indexes or based pointers such that only a few real 64-bit pointers exist and most of your data structures use smaller (32 or 16 bit) offsets.&amp;nbsp; This is somewhat contrary to classic x86 style because why store a 32-bit integer array index, when you could use a direct pointer instead and they both take the same size.&amp;nbsp; Now that they aren't the same size, you need to carefully think about your pointers.&amp;nbsp; Do you really need a 64-bit pointer or can you get away with a 32-index somehow?&lt;/p&gt; &lt;p&gt;The other advantage is that the registers are bigger, and you get more of them.&amp;nbsp; More registers means more things can get enregistered, but only if you don't do things like take their address, pass them by reference, or other such things.&amp;nbsp; Bigger registers mean that the few places where you actually use 64-bit integers, it is now more efficient!&lt;/p&gt; &lt;p&gt;So what's the final answer?&amp;nbsp; Well my &lt;u&gt;heuristic&lt;/u&gt; would be this: do you deal with &lt;strong&gt;BIG&lt;/strong&gt; stuff?&amp;nbsp; If&amp;nbsp; yes, then try compiling 64-bit otherwise stick with 32-bit.&amp;nbsp; If performance really matters and you're willing to spend several months re-architecting to use fewer pointers, then try 64-bit, but make sure to measure everything.&lt;/p&gt; &lt;p&gt;--Grant&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=361852" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/grantri/archive/tags/64-Bit/default.aspx">64-Bit</category></item><item><title>64-bit beta is official!</title><link>http://blogs.msdn.com/grantri/archive/2004/12/01/273257.aspx</link><pubDate>Wed, 01 Dec 2004 20:40:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:273257</guid><dc:creator>grantri</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/grantri/comments/273257.aspx</comments><wfw:commentRss>http://blogs.msdn.com/grantri/commentrss.aspx?PostID=273257</wfw:commentRss><wfw:comment>http://blogs.msdn.com/grantri/rsscomments.aspx?PostID=273257</wfw:comment><description>&lt;p&gt;Finally I have something to write about!&amp;nbsp; There's a new section on MSDN that is definitely worth reading:&lt;/p&gt; &lt;p&gt;&lt;a href="http://msdn.microsoft.com/netframework/programming/64bit/"&gt;64-Bit .NET Framework (http://msdn.microsoft.com/netframework/programming/64bit/)&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Now you only need a new 64-bit machine and OS to try it out on.&lt;/p&gt; &lt;p&gt;--Grant&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=273257" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/grantri/archive/tags/64-Bit/default.aspx">64-Bit</category></item></channel></rss>