<?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>Visual C++ Team Blog</title><link>http://blogs.msdn.com/b/vcblog/</link><description>All things Visual C++!</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>New Channel 9 video on the Visual Studio 3D Starter Kit now online</title><link>http://blogs.msdn.com/b/vcblog/archive/2013/05/24/new-channel-9-video-on-the-visual-studio-3d-starter-kit-now-online.aspx</link><pubDate>Fri, 24 May 2013 17:50:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10421225</guid><dc:creator>Jennifer Leaf [MSFT]</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/vcblog/rsscomments.aspx?WeblogPostID=10421225</wfw:commentRss><comments>http://blogs.msdn.com/b/vcblog/archive/2013/05/24/new-channel-9-video-on-the-visual-studio-3d-starter-kit-now-online.aspx#comments</comments><description>&lt;p&gt;If you&amp;rsquo;re interested in DirectX development, head on over to Channel 9, where there&amp;rsquo;s &lt;a href="http://channel9.msdn.com/posts/Creating-the-Virtual-Experiment-Laboratory-app-with-the-Visual-Studio-3D-Starter-Kit"&gt;a new video about the Visual Studio 3D Starter Kit&lt;/a&gt;.&amp;nbsp; This time, Roberto Sonnino interviews Gokhan Sengun, who&amp;rsquo;s created the Virtual Experiment Laboratory app, which is the first known app on the Windows Store that was built using the Starter Kit - at least, that wasn&amp;rsquo;t built by a Microsoft employee.&amp;nbsp; :)&amp;nbsp; Gohkan shares some tips on using the Starter Kit, and also some great demos of the Visual Studio Shader Designer.&lt;br /&gt;&amp;nbsp;&lt;br /&gt;To learn more about the Visual Studio 3D Starter Kit, check out our previous &lt;a href="http://blogs.msdn.com/b/vcblog/archive/2013/02/13/visual-studio-3d-starter-kit-now-for-windows-phone-8.aspx"&gt;introduction to the Starter Kit&lt;/a&gt;, the 3-part series on the Visual C++ blog and the accompanying video (&lt;a href="http://blogs.msdn.com/b/vcblog/archive/2013/03/26/developing-an-app-with-the-visual-studio-3d-starter-kit-part-1-of-3.aspx"&gt;part 1&lt;/a&gt;, &lt;a href="http://blogs.msdn.com/b/vcblog/archive/2013/04/02/developing-an-app-with-the-visual-studio-3d-starter-kit-part-2-of-3.aspx"&gt;part 2&lt;/a&gt;, &lt;a href="http://blogs.msdn.com/b/vcblog/archive/2013/04/11/developing-an-app-with-the-visual-studio-3d-starter-kit-part-3-of-3.aspx"&gt;part 3&lt;/a&gt;, &lt;a href="http://channel9.msdn.com/posts/VS-3D-Starter-Kit-Dice-Roller"&gt;Channel9 video&lt;/a&gt;), or just &lt;a href="http://aka.ms/vs3dkit"&gt;download the Starter Kit&lt;/a&gt; directly.&lt;br /&gt;&amp;nbsp;&lt;br /&gt;If you&amp;rsquo;re working on an app using the Starter Kit, we&amp;rsquo;d love to hear from you.&amp;nbsp; Leave us a note in the comments!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10421225" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/vcblog/archive/tags/DirectX/">DirectX</category><category domain="http://blogs.msdn.com/b/vcblog/archive/tags/Graphics/">Graphics</category><category domain="http://blogs.msdn.com/b/vcblog/archive/tags/C_2B002B00_/">C++</category><category domain="http://blogs.msdn.com/b/vcblog/archive/tags/windows+8/">windows 8</category><category domain="http://blogs.msdn.com/b/vcblog/archive/tags/Windows+Store+Apps/">Windows Store Apps</category><category domain="http://blogs.msdn.com/b/vcblog/archive/tags/3D+Starter+Kit/">3D Starter Kit</category><category domain="http://blogs.msdn.com/b/vcblog/archive/tags/VS2012/">VS2012</category></item><item><title>Image Processing with C++ AMP and the .NET Framework</title><link>http://blogs.msdn.com/b/vcblog/archive/2013/05/21/image-processing-with-c-amp-and-the-net-framework.aspx</link><pubDate>Tue, 21 May 2013 16:28:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10420156</guid><dc:creator>Eric Battalio</dc:creator><slash:comments>3</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/vcblog/rsscomments.aspx?WeblogPostID=10420156</wfw:commentRss><comments>http://blogs.msdn.com/b/vcblog/archive/2013/05/21/image-processing-with-c-amp-and-the-net-framework.aspx#comments</comments><description>&lt;p&gt;Image processing is a computational task that lends itself very well to GPU compute scenarios. In many cases the most commonly used algorithms are inherently massively parallel, with each pixel in the image being processed independently from the others. As a result, image processing toolkits have been early adopters of the new GPGPU programming model. Many of these mass-market toolkits, however, can be more accurately described as &lt;em&gt;image manipulation&lt;/em&gt; packages that offer "image-in, image-out" capabilities; in other words, for each operation there is an input image and a resulting output (manipulated) image. In contrast, an &lt;em&gt;image processing&lt;/em&gt; workflow differs from this in that the goal is usually the portrayal or extraction of analytical information which is determined after some multi-step processing workflow. These workflows are commonly employed in scientific and technical industries like medical imaging.&lt;/p&gt;
&lt;p&gt;For the last two years, Core Optical Inc. has been building an image processing toolkit for the .NET framework called &lt;a href="http://www.coreoptical.com/"&gt;PrecisionImage.NET&lt;/a&gt;. Internally it centers around two separate execution branches, one targeting multicore CPUs and the other targeting GPU execution. While the CPU branch is a fully-managed CLS-compliant implementation leaning heavily on the .NET framework's excellent built-in thread pool, the GPU branch is implemented using Microsoft's brand new C++ AMP compiler.&lt;/p&gt;
&lt;p&gt;We had two requirements when choosing the GPGPU tool we would use for that branch of our toolkit. First, the generated code needed to be vendor agnostic so that a decision to use our SDK wouldn't overly restrict our customer's choice concerning graphics hardware. The current minimum platform for C++ AMP is DirectX 11, a version that will soon be ubiquitous among modern GPUs from Intel, Nvidia and AMD. Secondly, since we focus on the Microsoft developer stack we needed something that would play nicely with the .NET framework. Obviously C++ AMP is the best bet in this regard since it's produced by Microsoft.&lt;/p&gt;
&lt;p&gt;For a v1 product we've found C++ AMP to be both solid and easy to program to. Although Microsoft doesn't produce an official managed wrapper, accessing AMP in .NET was a straight forward matter of P/Invoking from our existing C# code base. To keep the surface area between the two to a minimum, we stuck with our managed code for the CPU fallback and condensed the various operations of the SDK into hundreds of compact AMP kernels compiled in combinations of single/double precision and 32/64-bit implementations. In almost all cases we found the simpler untiled model readily met our speedup goals. When this wasn't the case, we were able to produce a tiled version that met our performance objectives with minimum drama.&lt;/p&gt;
&lt;p&gt;To demonstrate the performance of the GPU branch we decided to &lt;a href="http://coreoptical.wordpress.com/"&gt;compare the speed&lt;/a&gt; of two operations running on a 6-core CPU (multithreaded managed code) versus the C++ AMP version running on two different GPUs from Nvidia. The first operation was chosen as an ideal case for GPU implementation and consisted of a 2D convolution using a large kernel implemented using AMP's simple untiled model. The second was chosen as for its unsuitability to GPU processing and was implemented using the tiled model. Even when including the overhead of marshalling arguments from managed to native code, and memory copying to/from the GPU, we saw huge gains (60x) in the first test case. Perhaps more surprising were the gains achieved in the second, less suitable, test case &amp;ndash; up to 7x &amp;ndash; an indication of the quality of the AMP compiler. Based on our experience to date, if you are a developer considering using AMP from a managed code base we can recommend it without reservation.&lt;/p&gt;
&lt;p&gt;Currently, one aspect of C++ AMP imposes a performance limitation (acknowledged by Microsoft) for our particular use cases: redundant memory copying between CPU and GPU. This is partly imposed by hardware and partly by software. Since our SDK is designed to allow the easy assembly of processing chains, the overhead of these redundant memory copies can add up quickly. Microsoft has stated that this behavior needs improvement, and all our AMP kernels are using the &lt;em&gt;array_view&lt;/em&gt; abstraction to take advantage of the improvement when it arrives. This will be a welcome enhancement to the AMP implementation, especially given AMD's recent announcement of their hUMA architecture initiative. With both the hardware and software pieces falling into place soon, we should see a whole new generation of image processing software with unprecedented power and flexibility.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10420156" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/vcblog/archive/tags/C_2B002B00_/">C++</category><category domain="http://blogs.msdn.com/b/vcblog/archive/tags/AMP/">AMP</category></item><item><title>Speed up Windows PHP Performance using Profile Guided Optimization (PGO) </title><link>http://blogs.msdn.com/b/vcblog/archive/2013/05/08/speeding-up-php-performance-for-your-application-using-profile-guided-optimization-pgo.aspx</link><pubDate>Wed, 08 May 2013 17:38:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10415236</guid><dc:creator>Ankit Asthana</dc:creator><slash:comments>6</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/vcblog/rsscomments.aspx?WeblogPostID=10415236</wfw:commentRss><comments>http://blogs.msdn.com/b/vcblog/archive/2013/05/08/speeding-up-php-performance-for-your-application-using-profile-guided-optimization-pgo.aspx#comments</comments><description>&lt;p&gt;To introduce myself I am &lt;a href="mailto:aasthan@microsoft.com"&gt;Ankit Asthana&lt;/a&gt; and I am the program manager for the backend C++ compiler. In my last two blogs I provided an introduction to what &lt;a href="http://msdn.microsoft.com/en-us/library/e7k32f4k(v=vs.80).aspx"&gt;Profile Guided Optimization (PGO&lt;/a&gt;) is all about and a &lt;a href="http://blogs.msdn.com/b/vcblog/archive/2013/04/22/profile-guided-optimization-drives-next-generation-sap-netweaver-performance.aspx"&gt;case study&lt;/a&gt; which illustrates how PGO is used to make &lt;strong&gt;SAP NetWeaver&lt;/strong&gt; faster.&amp;nbsp; In this blog I would like to present the story about how PGO is used make official &lt;a href="http://windows.php.net/"&gt;Windows PHP&lt;/a&gt; binaries faster. &lt;strong&gt;Stephen Zarkos &lt;/strong&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;em&gt;Program Manager for Windows PHP&lt;/em&gt;&lt;strong&gt;)&lt;/strong&gt; has been kind enough for providing the content for this blog.&lt;br /&gt; &lt;br /&gt; &amp;nbsp;After reading this blog you folks should be able to further understand and use this case study to introduce PGO for your applications. In addition to this, for experienced PHP users, this blog post &lt;strong&gt;should serve as an optimization opportunity&lt;/strong&gt; to further optimize Windows PHP performance for their specific workloads. So let's get started! &lt;br /&gt; &lt;br /&gt; As most of you probably already know PHP is a server side scripting language designed for web development but also used as a general purpose programming language. PHP is heavily used today and it powers millions of websites and webservers. In addition to this PHP is also used to power a plethora of open source content management system (CMS) such as Joomla, WordPress and Drupal. &lt;br /&gt; &lt;br /&gt; The effort to PGO'ize the Windows PHP binaries was led by &lt;strong&gt;Microsoft Open Source Technology (OSTC) group&lt;/strong&gt;. OSTC's primary goal is to work with open-source communities to help their software interoperate with or run better on Windows Server and Windows Azure. To be precise, this is not the only group at Microsoft that works with open source but amazingly these days is only one of many. A few examples of projects this group works on are PHP on Windows, Openstack with Hyper-V, CoApp (coapp.org) and the Linux Integration Services for Hyper-V and Azure. &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;h2&gt;Why Windows-PHP team used Profile Guided Optimization (PGO)?&lt;/h2&gt;
&lt;p&gt;Over the past several years, Microsoft and its partners have worked diligently with the PHP community to improve the experience PHP developers and users have on&amp;nbsp;&lt;a href="http://php.iis.net/" target="_blank"&gt;Windows Server&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://www.windowsazure.com/en-us/develop/php/" target="_blank"&gt;Windows Azure&lt;/a&gt;. As a result newer versions of PHP (i.e. PHP 5.4) for Windows include dramatic improvements that come from a deep collaboration between the PHP Core Maintainers and Microsoft. One factor attributing to a faster &lt;strong&gt;Windows PHP 5.4 and 5.5&lt;/strong&gt; is &lt;strong&gt;Profile Guided Optimization (PGO)&lt;/strong&gt;. The overall goal with this collaboration is to improve PHP on Windows and enable Windows specific capabilities in a way that provides PHP users the same (or better, if possible) capabilities that they see on other platforms.&lt;br /&gt; &lt;br /&gt; After having tested the water with using &lt;strong&gt;PGO for Windows PHP 5.3&lt;/strong&gt;, the team was finally able to incorporate PGO for &lt;strong&gt;Windows PHP 5.4&lt;/strong&gt;. Performance is a primary goal for the Windows PHP team which served as the key reason behind PGO'izing the PHP binaries on Windows. PGO provided an important opportunity to optimize the performance of the PHP interpreter without changing any functional behavior.&amp;nbsp;&lt;/p&gt;
&lt;h2&gt;What are the 'key steps' performed by the Windows PHP team for PGO'izing Windows PHP binaries?&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/h2&gt;
&lt;p&gt;Revisiting my previous blogs, there are essentially three steps required in PGO'izing an application (Instrument, Train and Optimize). Remember the 'Instrument' and 'Optimize' steps require an &lt;a href="http://msdn.microsoft.com/en-us/library/xbf3tbeh.aspx"&gt;&lt;strong&gt;'LTCG:PGINSTRUMENT'&lt;/strong&gt;&lt;/a&gt; and &lt;a href="http://msdn.microsoft.com/en-us/library/xbf3tbeh.aspx"&gt;'&lt;strong&gt;LTCG:PGOPTIMIZE&lt;/strong&gt;'&lt;/a&gt; build respectively (for more information please take a look at my last &lt;a href="http://blogs.msdn.com/b/vcblog/archive/2013/04/04/how-to-build-faster-and-high-performing-native-applications-using-pgo.aspx"&gt;&lt;span&gt;blog&lt;/span&gt;&lt;/a&gt;&amp;nbsp;post).&lt;/p&gt;
&lt;p&gt;The steps to PGO'ize Windows PHP binaries are essentially in-line with PGO'izing any generic application and are as follows:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Creating an Instrumented build of Windows PHP binaries (i.e. the Instrumentation Phase)&lt;br /&gt; &lt;/strong&gt;&lt;br /&gt; For those of you who would like to get some firsthand experience in doing this, creating an instrumented version of the Windows PHP binaries requires user to pass the additional '&lt;strong&gt;--enable-pgi&lt;/strong&gt;' parameter to the PHP &lt;em&gt;configure&lt;/em&gt; script. After running the &lt;em&gt;configure&lt;/em&gt; script just rebuild with &lt;strong&gt;&lt;em&gt;'nmake snap'&lt;/em&gt;&lt;/strong&gt;. For more detailed instructions on how to set this up take a look at this &lt;a href="http://www.ksingla.net/2010/05/php-pgo-build-for-maximum-performance-on-windows/"&gt;blog post&lt;/a&gt;.&lt;br /&gt;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Collecting Training Data (i.e. the Train Phase)&lt;br /&gt; &lt;/strong&gt;&lt;br /&gt; This step can be as simple as setting up PHP with IIS or Apache with your PHP application and then accessing the application via a web-browser. A good training session should exercise workflows that your users will hit most often. The Windows PHP team currently trains by having a number of PHP applications preconfigured, for both IIS and Apache (on Windows) and then exercising these applications via requesting specific pages (usually several times for the most used pages) in order to get wide coverage. As of today, the Windows PHP team trains with every snapshot and release build of PHP binaries.&lt;br /&gt; &lt;br /&gt; Snapshot builds can happen multiple times a day (depending on the number of commits on that particular day).&amp;nbsp; Every snapshot for PHP 5.4, 5.5 and the Master branch is automated where the build automation goes through the process of creating the instrumented binary, setting up IIS and Apache, running through a series of applications to produce the training data, copying those back to the PHP build directory and then finally rebuilding the optimized PHP.&lt;br /&gt; &lt;br /&gt; The end result of the training phase is the "*.pgc" files which are essentially training data files that contain all the information required by the 'Optimize phase'. You need to copy these files back into your PHP build directory for the next phase of the build.&lt;br /&gt;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Building optimized Windows PHP binaries (i.e. the Optimize Phase) &lt;br /&gt; &lt;br /&gt; &lt;/strong&gt;&lt;strong&gt;A user can build an optimized version of PHP binaries &lt;/strong&gt;following the simple steps listed below:&lt;br /&gt; a. Copy the *.pgc files back to your PHP build directory&lt;br /&gt; b. Run the command "nmake --clean-pgo" to clean your build directory (but not the .pgc files)&lt;br /&gt; c. Re-run the configure script, but remove the "--enable-pgi" parameter and instead add the "--with-pgo" parameter&lt;br /&gt; d. Run "nmake" and then "nmake snap" to build the final optimized PHP&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This entire process can take several hours, depending upon the speed of your build machine. For best results (i.e higher build throughput and maximum PGO performance gains), use Visual Studio 2012 RTM.&amp;nbsp;&lt;/p&gt;
&lt;h2&gt;What were the 'key challenges' faced by the Windows PHP team while PGO'izing Windows PHP binaries?&lt;/h2&gt;
&lt;p&gt;The work for PGO'izing PHP began as a proof of concept exercise. The Windows PHP team did some work several years ago to test PGO and see how they can leverage it for PHP. This exercise was useful in finding the following &lt;strong&gt;few key challenges&lt;/strong&gt; which the team addressed when enabling PGO for PHP 5.4:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;How to train the PHP binaries:&lt;/strong&gt; At first it was difficult for the Windows PHP team to understand how best to train the PHP Windows binaries. In particular, 'what training scenarios to run?', 'how long to train for?' and 'what kind of applications to train with?'&lt;br /&gt;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Absorbing longer build times: &lt;/strong&gt;To save man hours, every part of the 'Windows PHP PGO build process was automated. Adding PGO to the build process was a fairly easy exercise, but the main challenge here was to deal with the additional build times required. Given the Windows PHP has various builds (thread-safe, non-thread, and now x86 &amp;amp; x64 for PHP 5.5) to absorb the additional build times they needed to add more/faster build systems, and improve their build automation to support concurrent builds&lt;strong&gt;.&lt;br /&gt;&amp;nbsp;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Additional quality assurance required: &lt;/strong&gt;Validating the effectiveness of your PGO training scenario is essential and plays a major part in obtaining maximum performance gains. Good testing is still the key to the success of PGO in PHP.&amp;nbsp; At the time PHP 5.4 was released the Windows PHP team had pretty good test automation and hence were able to identify issues where using PGO changed the behavior of PHP.&amp;nbsp; These issues observed were then mitigated by the use of #pragma statements.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;What are the performance gains received by the Windows PHP team by PGO'izing their binaries?&lt;/h2&gt;
&lt;p&gt;For testing PHP performance, applications such as Drupal, Mediawiki, Wordpress and Joomla are deployed on IIS and Apache webservers. These applications are then stressed using load agents and various metrics such as &lt;strong&gt;transactions per second (TPS)&lt;/strong&gt; are recorded and reported. To better demonstrate the performance improvements we can see with PGO, the 'TPS' for these applications with/without PGO'ized PHP binaries is listed in the table below: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-69/5684.PerformanceGains.png"&gt;&lt;img src="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-69/5684.PerformanceGains.png" alt="" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;em&gt;Table 1: Performance gain for applications leveraging PGO'ized Windows PHP 5.5 &lt;/em&gt;&lt;/p&gt;
&lt;p&gt;As you can see some of these results are pretty &lt;strong&gt;impressive&lt;/strong&gt;! A detailed summary of these results which includes some of the gritty details used to generate these results can be found &lt;strong&gt;&lt;a href="http://windows.php.net/downloads/snaps/ostc/pftt/perf/results-20130430-5.5.0beta4-5.5.0beta4nonPGO-1246.html"&gt;here&lt;/a&gt;&lt;/strong&gt;&lt;strong&gt;.&lt;/strong&gt;&lt;/p&gt;
&lt;h2&gt;&lt;span style="font-size: 1.5em;"&gt;Wrap up&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;Although Profile Guided Optimization (PGO) is a complex technology, I hope this blog provides you further evidence on the usefulness of PGO and does a fair job in explaining how the Windows PHP team PGO'ized the Windows PHP binaries. In my future blogs I will go over how PGO works under the hood to provide the performance gains enjoyed by a plethora of products out there.&lt;/p&gt;
&lt;p&gt;So stay tuned! Additionally, if you would like us to blog about some other PGO-related scenarios or are just curios and have a few more questions about PGO please feel free to reach out to &lt;a href="mailto:aasthan@microsoft.com"&gt;me&lt;/a&gt;. I will do my best to answer them.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10415236" width="1" height="1"&gt;</description></item><item><title>NuGet for C++ and the Northwest Hackathon</title><link>http://blogs.msdn.com/b/vcblog/archive/2013/05/08/nuget-for-c-and-the-northwest-hackathon.aspx</link><pubDate>Wed, 08 May 2013 17:16:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10416445</guid><dc:creator>Garrett Serack, MSFT</dc:creator><slash:comments>4</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/vcblog/rsscomments.aspx?WeblogPostID=10416445</wfw:commentRss><comments>http://blogs.msdn.com/b/vcblog/archive/2013/05/08/nuget-for-c-and-the-northwest-hackathon.aspx#comments</comments><description>&lt;p&gt;Howdy!&lt;/p&gt;
&lt;p&gt;My name is&amp;nbsp;&lt;a href="http://blogs.msdn.com/b/garretts/"&gt;Garrett Serack&lt;/a&gt;, I'm not actually part of the Visual C++ team--I actually work as a Senior Software Development Engineer in Microsoft's Open Source Technology Center, which is part of Windows Server. I have a distinctly different job than most here at Microsoft-I work to get Open Source software running better on Windows and Azure.&lt;/p&gt;
&lt;p&gt;A&amp;nbsp;&lt;a href="http://blogs.msdn.com/b/vcblog/archive/2013/04/26/nuget-for-c.aspx"&gt;little over a week ago&lt;/a&gt;, I released the beta version of the&amp;nbsp;&lt;a href="http://coapp.org/news/2013-04-26-Announcing-CoApp-Tools-For-NuGet.html"&gt;CoApp PowerShell tools&lt;/a&gt;&amp;nbsp;that let us generate &lt;a href="http://blogs.msdn.com/controlpanel/blogs/posteditor.aspx/http::/nuget.org"&gt;NuGet &lt;/a&gt;packages for C and C++ libraries.&lt;/p&gt;
&lt;p&gt;Over the next few weeks, I'll try to explain what the heck goes on under the covers when creating packages for Visual C++, how you can exploit all of the power of Visual Studio in C/C++ packages and in the process, explore what it would take to manually create packages without the tools.&lt;/p&gt;
&lt;p&gt;Today however, I'm here for a slightly different purpose: We're having an&amp;nbsp;&lt;a href="http://coapp.org/news/2013-05-06-Northwest-Hackathon.html"&gt;Open Source "Hackathon"&lt;/a&gt;&amp;nbsp;here on campus this Friday and Saturday (&lt;strong&gt;May 10th and 11th&lt;/strong&gt;), and I'm offering the opportunity for anyone interested in building C/C++ packages with NuGet to come on out, learn, code and have a good time. I'll be on hand all day and into the evening Friday and Saturday hacking away, and helping out anyone who's interested.&lt;/p&gt;
&lt;p&gt;Also, folks from the the NuGet team itself will be around, so if you have questions for them, you know where they will be!&lt;/p&gt;
&lt;p&gt;We're gonna have a ton of&amp;nbsp;&lt;strong&gt;food&lt;/strong&gt;,&amp;nbsp;&lt;strong&gt;prizes&lt;/strong&gt;,&amp;nbsp;&lt;strong&gt;drinks&lt;/strong&gt;, and a lot of fun. If you're into Open Source, and are in the area, I'd love to have you come out, hang around and write some code!&lt;/p&gt;
&lt;h3&gt;&lt;span style="font-size: medium;"&gt;&lt;strong&gt;&lt;a href="http://coapp.org/news/2013-05-06-Northwest-Hackathon.html"&gt;Don't forget to register!&lt;/a&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/h3&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10416445" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/vcblog/archive/tags/NuGet+OpenSource/">NuGet OpenSource</category></item><item><title>Fix: Visual Studio 2012 Update 2 breaks Windows XP targeting with ATL and/or statically linking MFC</title><link>http://blogs.msdn.com/b/vcblog/archive/2013/05/07/fix-visual-studio-2012-update-2-breaks-windows-xp-targeting-with-atl-and-or-statically-linking-mfc.aspx</link><pubDate>Tue, 07 May 2013 22:25:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10416816</guid><dc:creator>Eric Battalio</dc:creator><slash:comments>30</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/vcblog/rsscomments.aspx?WeblogPostID=10416816</wfw:commentRss><comments>http://blogs.msdn.com/b/vcblog/archive/2013/05/07/fix-visual-studio-2012-update-2-breaks-windows-xp-targeting-with-atl-and-or-statically-linking-mfc.aspx#comments</comments><description>&lt;p&gt;Recently, some of our customers reported a bug in Visual Studio 2012 Update 2 that breaks Windows XP targeting with C++ in some scenarios. Specifically, applications using ATL and/or statically linking with MFC will get the following error when run on Windows XP:&lt;/p&gt;
&lt;p style="margin-left: 36pt;"&gt;"The procedure entry point InitializeCriticalSectionEx could not be located in the dynamic link library kernel32.dll."&lt;/p&gt;
&lt;p&gt;This issue has been fixed in &lt;a href="http://go.microsoft.com/fwlink/?LinkID=290979" target="_blank"&gt;Visual Studio 2012 Update 3 RC1&lt;/a&gt;. If you encounter this issue, please download and install this update.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10416816" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/vcblog/archive/tags/Announcements/">Announcements</category></item><item><title>NuGet for C++</title><link>http://blogs.msdn.com/b/vcblog/archive/2013/04/26/nuget-for-c.aspx</link><pubDate>Fri, 26 Apr 2013 18:23:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10413561</guid><dc:creator>Jennifer Leaf [MSFT]</dc:creator><slash:comments>12</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/vcblog/rsscomments.aspx?WeblogPostID=10413561</wfw:commentRss><comments>http://blogs.msdn.com/b/vcblog/archive/2013/04/26/nuget-for-c.aspx#comments</comments><description>&lt;p&gt;The wait is over.&amp;nbsp; &lt;a href="http://blog.nuget.org/20130425/nuget-2.5-released.html"&gt;NuGet support for C++ projects is here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Quick Links&lt;/strong&gt;&lt;br /&gt;&amp;bull;&amp;nbsp;NuGet 2.5 Download page: &lt;a href="https://nuget.codeplex.com/releases/view/96733"&gt;https://nuget.codeplex.com/releases/view/96733&lt;/a&gt;&lt;br /&gt;&amp;bull;&amp;nbsp;CoApp&amp;rsquo;s Powershell Tools Installer to create C++&amp;nbsp;NuGet packages: &lt;a href="http://coapp.org/releases"&gt;http://coapp.org/releases&lt;/a&gt;&lt;br /&gt;&amp;bull;&amp;nbsp;Some C++ NuGet packages to try out:&amp;nbsp; &lt;a href="http://nuget.org/profiles/coapp/"&gt;http://nuget.org/profiles/coapp/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Start downloading, then head on back here to learn more about NuGet and how to create and use packages for C++ libraries.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What is NuGet?&lt;/strong&gt;&lt;br /&gt;From the &lt;a href="http://docs.nuget.org/docs/start-here/overview"&gt;NuGet website&lt;/a&gt;:&amp;nbsp;&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;NuGet is a Visual Studio extension that makes it easy to add, remove, and update libraries and tools in Visual Studio projects... If you develop a library or tool that you want to share with other developers, you create a NuGet package and store the package in a NuGet repository. If you want to use a library or tool that someone else has developed, you retrieve the package from the repository and install it in your Visual Studio project or solution.&lt;/p&gt;
&lt;p&gt;If you&amp;rsquo;ve used NuGet in other Visual Studio projects (say, for C# or JavaScript development), then you&amp;rsquo;ll have no additional learning curve using NuGet for C++ in Visual Studio - downloading and installing packages works the same way.&lt;/p&gt;
&lt;p&gt;With the NuGet 2.5 release, you can download and add libraries to your C++ projects without having to configure properties for include or library directories, and making sure those properties are set correctly in all of your project configurations.&amp;nbsp; For C++, the way we implement this is by generating files with MSBuild properties and targets, and including those files in the NuGet package.&amp;nbsp; When the package is installed and referenced by your project, the MSBuild files are imported into your project file, so your projects will know how to find and use the contents of the NuGet packages.&amp;nbsp; Packages are cached on a per-solution basis &amp;ndash; if you&amp;rsquo;re using the same library in multiple projects in your solution, they&amp;rsquo;ll point to a common copy of the package.&lt;/p&gt;
&lt;p&gt;Check out &lt;a href="http://blog.nuget.org/20130426/native-support.html"&gt;this post&lt;/a&gt; on the NuGet team blog&amp;nbsp;for a more in-depth look at how NuGet for C++ was designed.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Getting Started&lt;/strong&gt;&lt;br /&gt;NuGet is included in both Visual Studio 2010 and Visual Studio 2012.&amp;nbsp; You&amp;rsquo;ll need to update the &lt;a href="http://visualstudiogallery.msdn.microsoft.com/27077b70-9dad-4c64-adcf-c7cf6bc9970c"&gt;NuGet extension&lt;/a&gt; to version 2.5 in order to use the C++ project integration.&amp;nbsp; The NuGet website (&lt;a href="http://nuget.org"&gt;nuget.org&lt;/a&gt;) has extensive documentation on how to &lt;a href="http://docs.nuget.org/docs/start-here/installing-nuget"&gt;install&lt;/a&gt; and &lt;a href="http://docs.nuget.org/"&gt;use&lt;/a&gt; NuGet.&amp;nbsp; You can use NuGet in any C++ project type &amp;ndash; this works for desktop, Windows Store, and Windows Phone 8 applications equally.&lt;/p&gt;
&lt;p&gt;The NuGet Gallery on &lt;a href="http://nuget.org"&gt;nuget.org&lt;/a&gt; is the central package repository used by all package authors and consumers.&amp;nbsp; Since C++ support in NuGet is brand new, there aren&amp;rsquo;t a lot of packages available in the NuGet Gallery yet.&amp;nbsp; However, the CoApp project has created a few packages from open source libraries&amp;nbsp;which you can use right now&amp;nbsp;to get started.&amp;nbsp; You can find their packages on the NuGet gallery &lt;a href="http://nuget.org/profiles/coapp/"&gt;here&lt;/a&gt;.&amp;nbsp;To find other packages, try using a search on &amp;ldquo;tag:native&amp;rdquo; on the NuGet Gallery (this also works when searching for packages using the VS IDE integration), though be aware that not all packages tagged with &amp;ldquo;native&amp;rdquo; are actually C++ projects.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Creating packages&lt;/strong&gt;&lt;br /&gt;If you&amp;rsquo;re interested in publishing your libraries via NuGet, you can choose to create the NuGet packages manually.&amp;nbsp; However, there&amp;rsquo;s an easier way.&amp;nbsp; The CoApp project volunteered to write C++ oriented tools to create NuGet packages, and have &lt;a href="http://coapp.org/pages/releases.html"&gt;released a beta version&lt;/a&gt; of their tools on their website.&amp;nbsp; These tools simplify the process of generating the MSBuild files and NuGet packages from existing header and library files &amp;ndash; you just need to create a configuration script to describe the contents of the package, and then run the tools to generate the NuGet package.&lt;/p&gt;
&lt;p&gt;There are &lt;a href="http://coapp.org/pages/tutorials.html"&gt;tutorials&lt;/a&gt;, &lt;a href="http://coapp.org/pages/reference.html"&gt;reference&lt;/a&gt; documentation, and a &lt;a href="https://www.youtube.com/watch?v=l4MAkR13JPA"&gt;video&lt;/a&gt; on how to use the tools to create NuGet packages.&amp;nbsp; The CoApp project organizers also plan to create and publish packages for several open source libraries into the NuGet Gallery over the next several weeks.&lt;/p&gt;
&lt;p&gt;At this time, we&amp;rsquo;re encouraging people to publish packages with the &amp;ldquo;native&amp;rdquo; tag to make it easier to find packages you can use in C++ projects.&lt;/p&gt;
&lt;p&gt;The &lt;a href="http://coapp.org/news/2013-04-26-Announcing-CoApp-Tools-For-NuGet.html"&gt;CoApp&lt;/a&gt; and &lt;a href="http://blogs.technet.com/b/openness/archive/2013/04/26/nuget-coapp-release.aspx"&gt;Openness@Microsoft&lt;/a&gt; blogs have additional information about this project.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Feedback&lt;/strong&gt;&lt;br /&gt;Please leave us feedback here on the blog &amp;ndash; we&amp;rsquo;d love to hear your experiences trying out NuGet in your C++ projects, and whether there are additional features we could add to make this work even better for you.&amp;nbsp; This is just the start of C++ integration in NuGet&amp;nbsp; &amp;ndash; we need your input on where we should take this in the future to make working with C++ libraries in Visual Studio easier.&lt;/p&gt;
&lt;p&gt;If you have specific feedback or issues with these tools here are direct links to the project sites:&lt;br /&gt;-&amp;nbsp;&lt;a href="http://nuget.codeplex.com/"&gt;NuGet project on CodePlex&lt;/a&gt;&lt;br /&gt;-&amp;nbsp;&lt;a href="http://coapp.org/index.html"&gt;CoApp website&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10413561" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/vcblog/archive/tags/VS2010/">VS2010</category><category domain="http://blogs.msdn.com/b/vcblog/archive/tags/Build/">Build</category><category domain="http://blogs.msdn.com/b/vcblog/archive/tags/C_2B002B00_/">C++</category><category domain="http://blogs.msdn.com/b/vcblog/archive/tags/VS2012/">VS2012</category><category domain="http://blogs.msdn.com/b/vcblog/archive/tags/NuGet/">NuGet</category><category domain="http://blogs.msdn.com/b/vcblog/archive/tags/Libraries/">Libraries</category></item><item><title>Profile Guided Optimization (PGO) drives next generation SAP NetWeaver Performance</title><link>http://blogs.msdn.com/b/vcblog/archive/2013/04/22/profile-guided-optimization-drives-next-generation-sap-netweaver-performance.aspx</link><pubDate>Mon, 22 Apr 2013 05:57:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10411739</guid><dc:creator>Ankit Asthana</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/vcblog/rsscomments.aspx?WeblogPostID=10411739</wfw:commentRss><comments>http://blogs.msdn.com/b/vcblog/archive/2013/04/22/profile-guided-optimization-drives-next-generation-sap-netweaver-performance.aspx#comments</comments><description>&lt;p&gt;&lt;span style="font-family: arial,helvetica,sans-serif; font-size: small;"&gt;To introduce myself I am &lt;a href="mailto:aasthan@microsoft.com"&gt;Ankit Asthana&lt;/a&gt; and I am the program manager for the backend C++ compiler. In my last &lt;a href="http://blogs.msdn.com/b/vcblog/archive/2013/04/04/how-to-build-faster-and-high-performing-native-applications-using-pgo.aspx"&gt;&lt;span style="text-decoration: underline;"&gt;blog&lt;/span&gt;&lt;/a&gt; I provided an introduction to what &lt;a href="http://msdn.microsoft.com/en-us/library/e7k32f4k(v=vs.80).aspx"&gt;Profile Guided Optimization (PGO&lt;/a&gt;) is all about with an exercise which involved PGO&amp;rsquo;izing the &lt;strong&gt;NBody sample application&lt;/strong&gt;.&amp;nbsp; In this blog I would like to talk about how PGO is used within SAP to power and deliver next generation performance for &lt;a href="http://en.wikipedia.org/wiki/SAP_NetWeaver"&gt;SAP NetWeaver&lt;/a&gt;.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&lt;span style="font-family: arial,helvetica,sans-serif; font-size: small;"&gt; Starting with a little bit of history, the effort to PGO&amp;rsquo;ize &lt;a href="http://en.wikipedia.org/wiki/SAP_NetWeaver"&gt;SAP NetWeaver&lt;/a&gt; was undertaken and completed by &lt;strong&gt;SAPs Microsoft Platforms Group. &lt;/strong&gt;The &lt;strong&gt;SAP Microsoft Platforms&lt;/strong&gt; &lt;strong&gt;Group&lt;/strong&gt; is responsible for Microsoft Windows specific technology within &lt;strong&gt;SAP&amp;rsquo;s kernel. &lt;/strong&gt;This effort was in particular led by &lt;strong&gt;&lt;a title="Mike Gusev" href="mailto:mikhailg@microsoft.com"&gt;Mike Gusev&lt;/a&gt; and &lt;a title="Jason Kafka" href="mailto:Jason.kafka@sap.com"&gt;Jason Kafka&lt;/a&gt;&lt;/strong&gt;&lt;strong&gt;, &lt;/strong&gt;both senior members of SAPs Microsoft Platforms Group who were also kind enough to provide content for this blog. &lt;/span&gt;&lt;br /&gt; &lt;br /&gt;&lt;span style="font-family: arial,helvetica,sans-serif; font-size: small;"&gt; &amp;nbsp;With that said and done, let us get started with building some domain knowledge about &lt;a href="http://en.wikipedia.org/wiki/SAP_NetWeaver"&gt;SAP NetWeaver&lt;/a&gt; before we get into how and why PGO was introduced for &lt;a href="http://en.wikipedia.org/wiki/SAP_NetWeaver"&gt;SAP NetWeaver&lt;/a&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;h2&gt;SAP NetWeaver&lt;/h2&gt;
&lt;p&gt;&lt;span style="font-family: arial,helvetica,sans-serif; font-size: small;"&gt;&lt;a href="http://en.wikipedia.org/wiki/SAP_NetWeaver"&gt;SAP NetWeaver&lt;/a&gt; is an open platform that offers a comprehensive set of technologies for running mission-critical business applications and integrating people, processes, and information. In addition,&amp;nbsp; &lt;a href="http://en.wikipedia.org/wiki/SAP_NetWeaver"&gt;SAP NetWeaver&lt;/a&gt; serves as the technical foundation of SAP's Business Process Platform offerings by providing capabilities for service provisioning, composition (service consumption), and governance.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: arial,helvetica,sans-serif; font-size: small;"&gt;At the heart of applications running on &lt;a href="http://en.wikipedia.org/wiki/SAP_NetWeaver"&gt;SAP NetWeaver&lt;/a&gt; is SAP NetWeaver Application Server (AS) which serves as the central foundation for the entire SAP software stack. SAP NetWeaver Application Server (AS) comes in two flavors ABAP and Java. AS serves as an abstraction layer and handles calls from ABAP/Java applications to the underlying combination of operating system and database. Each Application server consists of a set of processes. These processes have one of the following roles (Dispatcher, Worker or Background). &lt;/span&gt;&lt;br /&gt; &lt;br /&gt;&lt;span style="font-family: arial,helvetica,sans-serif; font-size: small;"&gt; An Application Server has exactly one Dispatcher Process and several Worker processes which are needed for load distribution. The Dispatcher process is responsible for spawning additional processes and dispatching requests from the frontend to free Worker processes. The Background process is a special worker process. Each of these processes share the same application code (i.e. are spawned from the same binary) which is called the SAP Kernel.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;h2&gt;Why SAP NetWeaver used Profile Guided Optimization (PGO) ?&lt;/h2&gt;
&lt;p&gt;&lt;span style="font-family: arial,helvetica,sans-serif; font-size: small;"&gt;The primary data loop of the SAP kernel is single threaded by design. Although there exist dedicated threads for signal handling and high precision timing, the core itself is single threaded. The core consists of several modules which are mainly written in C, spanning several million lines of code. Newer kernel generations are designed differently, especially with multi-core machines in mind. Nevertheless the majority of customer base runs SAP NetWeaver products with the above described kernel architecture. Furthermore, the single threaded kernel, consists of a codebase which is extremely hard to refactor and given the very slow (if at all) growth in single core performance of modern CPU's , using PGO was a logical low cost step moving forward in order to gain more performance without redesigning, and possibly breaking, the current software.&lt;/span&gt;&lt;/p&gt;
&lt;h2&gt;How was Profile Guided Optimization (PGO) incorporated into SAP NetWeaver&lt;/h2&gt;
&lt;p&gt;&lt;span style="font-family: arial,helvetica,sans-serif;"&gt;&lt;span style="font-size: 10pt;"&gt;Before we get dig deep into the how, let us do a recap of how Profile Guided Optimization (PGO) works. There are essentially three steps required in PGO'izing an application (Instrument, Train and Optimize) as shown in figure 1 below. Remember the 'Instrument' and 'Optimize' steps require an &lt;a href="http://msdn.microsoft.com/en-us/library/xbf3tbeh.aspx"&gt;'LTCG:PGINSTRUMENT'&lt;/a&gt; and &lt;a href="http://msdn.microsoft.com/en-us/library/xbf3tbeh.aspx"&gt;'LTCG:PGOPTIMIZE'&lt;/a&gt; build respectively (for more information please take a look at my last &lt;a href="http://blogs.msdn.com/b/vcblog/archive/2013/04/04/how-to-build-faster-and-high-performing-native-applications-using-pgo.aspx"&gt;&lt;span style="text-decoration: underline;"&gt;blog&lt;/span&gt;&lt;/a&gt;&amp;nbsp;post).&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;img src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-69-metablogapi/5125.041713_5F00_0558_5F00_ProfileGuid1.png" alt="" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style="color: #44546a; font-size: 9pt;"&gt;&lt;em&gt;Figure 1: Steps involved in PGO'izing an application &lt;/em&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;When incorporating PGO as a part of their build process the SAP NetWeaver team had the following two goals in mind: &lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;span style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;&lt;strong&gt;Maintain the current build process!&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;The first goal was essential and can be applied generically for any product. The SAP NetWeaver team has a huge developer base which relies heavily on a working kernel with the latest changes which is produced by automated nightly builds. The PGO process was enabled as a part of this nightly build. As a failsafe, if any of the PGO steps were to fail (Instrument, Train or Optimize) the build would revert to provide a /O2 build. Alternatively, if&amp;nbsp;any&amp;nbsp;PGO steps&amp;nbsp;were to&amp;nbsp;fail the build could also be reverted back to an /LTCG build&amp;nbsp;in the process retaining most of the performance when compared to an /O2 build. &lt;/span&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;span style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;&lt;strong&gt;Automate! Automate! Automate!&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;As I mentioned, the PGO process for SAP NetWeaver was encapsulated within the automated nightly build process for the SAP Kernel. Although not required, the SAP NetWeaver team went down the approach of automating the PGO process. The major reasoning behind this was that the SAP NetWeaver team did not want to have a dedicated person/team responsible for training the Application Server and moving the resulting performance profiles (.pgd files) into the build process. Additionally adding weight to this goal was the fact that the build processes were supervised by a different department which was not knowledgeable in the art of compiler/linker error analysis or maintaining application server training scenarios. &lt;br /&gt;&lt;br /&gt;Again to clarify unless your code base significantly diverges on a daily basis (i.e. lot of churn in the code base) you are not required to perform 'instrument', 'train' steps in the PGO process. An optimized PGO build can be built repeatedly (without the instrumentation and training step) until the source base has vastly diverged from the last time the application was PGO-trained. For large development teams, an ideal workflow is for one developer doing PGO and checking the training data (.pgd) into the source repository. Other developers in the team should then be able to sync their code repositories and use the training data file to directly build PGO optimized builds. When the counts go stale over period of time, the application is PGO-retrained.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Performance Gains observed with PGO'izing the SAP Kernel&lt;/h2&gt;
&lt;p&gt;&lt;span style="font-family: arial,helvetica,sans-serif; font-size: small;"&gt;Performance gains observed by PGO&amp;rsquo;izing an application are directly proportional to how well the application was PGO-trained. In other words, the secret sauce behind getting the most out of PGO is choosing the right training scenario. Good training scenarios are typically modeled after real life performance centric user scenarios. There lies a fine balance between choosing a training scenario which is too specialized or too generalized. If it is too specialized, you will only optimize code used within few use cases, if it is too general you might miss that sweet spot which is relevant for most of your customers.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: arial,helvetica,sans-serif; font-size: small;"&gt;SAP&amp;rsquo;s Microsoft Platform group chose one of &lt;a href="http://www.sap.com/campaigns/benchmark/index.epx"&gt;SAP&amp;rsquo;s Standard Application Benchmarks&lt;/a&gt; as training scenario.&amp;nbsp; The benchmark simulates thousands of users performing typical business transactions in parallel. The benchmark puts a massive CPU intensive workload onto the Application Server and executes the relevant code paths in the &lt;strong&gt;SAP kernel &lt;/strong&gt;in the process PGO-training them.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: arial,helvetica,sans-serif; font-size: small;"&gt;Performance is measured in &lt;a href="http://www.sap.com/campaigns/benchmark/measuring.epx"&gt;SAP Application Performance Standard (SAPS) units&lt;/a&gt;, which basically describes how many business transactions could be processed per hour by the Application Server.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: arial,helvetica,sans-serif; font-size: small;"&gt;&lt;strong&gt;Using SAP Kernel built with &lt;/strong&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/xbf3tbeh.aspx"&gt;/LTCG&lt;/a&gt; &lt;strong&gt;as a baseline for performance comparison and using the VS2010 toolset. The performance gain observed with &lt;a href="http://msdn.microsoft.com/en-us/library/e7k32f4k(v=vs.80).aspx"&gt;PGO&amp;rsquo;izing&lt;/a&gt; the SAP kernel was up to 20% and in certain scenarios even higher.&lt;/strong&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;h2&gt;Wrap up&lt;/h2&gt;
&lt;p&gt;&lt;span style="font-family: arial,helvetica,sans-serif; font-size: small;"&gt;This should provide you folks with an idea on how PGO is used to make the &lt;strong&gt;SAP NetWeaver more performant&lt;/strong&gt;. Again to emphasize if your product&amp;rsquo;s core performance centric scenarios are native and the bottleneck is CPU bound PGO is worth a shot. In such scenarios PGO results in improved performance for a subset of important user centric scenarios without changing the source code of your application. &lt;/span&gt;&lt;br /&gt; &lt;br /&gt;&lt;span style="font-family: arial,helvetica,sans-serif; font-size: small;"&gt; In my future blogs I will try to cover more case studies for products using PGO and follow it up with a blog on &lt;strong&gt;&amp;lsquo;PGO under the hood&amp;rsquo;&lt;/strong&gt;. So stay tuned! Additionally, if you would like us to blog about some other PGO-related content please do let &lt;a href="mailto:aasthan@microsoft.com"&gt;me&lt;/a&gt; know.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10411739" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/vcblog/archive/tags/PGO/">PGO</category></item><item><title>Finding the Visual Studio Command Prompts in Visual Studio 2012</title><link>http://blogs.msdn.com/b/vcblog/archive/2013/04/19/finding-the-visual-studio-command-prompts-in-visual-studio-2012.aspx</link><pubDate>Fri, 19 Apr 2013 21:59:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10412693</guid><dc:creator>Jennifer Leaf [MSFT]</dc:creator><slash:comments>19</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/vcblog/rsscomments.aspx?WeblogPostID=10412693</wfw:commentRss><comments>http://blogs.msdn.com/b/vcblog/archive/2013/04/19/finding-the-visual-studio-command-prompts-in-visual-studio-2012.aspx#comments</comments><description>&lt;p&gt;If you&amp;rsquo;re using Visual Studio 2012 on Windows 8, you may be looking for the Visual Studio Command Prompt shortcuts.&amp;nbsp; These shortcuts are installed by Visual Studio to run scripts that configure the command line environment to use particular sets of Visual Studio tools, or to &lt;a href="http://msdn.microsoft.com/en-us/library/x4d2c09s(v=vs.110).aspx"&gt;use specific versions of the Visual C++ compiler&lt;/a&gt; from the command line.&lt;/p&gt;
&lt;p&gt;These shortcuts are installed with Visual Studio 2012, but only the &amp;ldquo;Developer Command Prompt for VS2012&amp;rdquo; (which is equivalent to the shortcut for the x86 native tools) is pinned to the Start screen by default.&amp;nbsp; The command prompts for the x64 cross tools, the x64 native tools, and the ARM cross tools are installed but aren&amp;rsquo;t pinned.&lt;/p&gt;
&lt;p&gt;To find these shortcuts, you can search for them at the Start screen (just type &amp;ldquo;VS2012 command prompt&amp;rdquo; without the quotes while you&amp;rsquo;re on the Start screen):&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-69/0456.start1.png"&gt;&lt;img src="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-69/0456.start1.png" alt="" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;If you want to keep them visible on your Start screen, you can right-click on the tile and choose &amp;ldquo;Pin to Start&amp;rdquo;:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-69/2746.start2.png"&gt;&lt;img src="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-69/2746.start2.png" alt="" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;(Please note: depending on the version of Visual Studio 2012 you have installed, you may not see the same list of command prompt shortcuts.&amp;nbsp; Not all shortcuts are installed with Visual Studio Express versions.)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10412693" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/vcblog/archive/tags/Command+Line/">Command Line</category><category domain="http://blogs.msdn.com/b/vcblog/archive/tags/Build/">Build</category><category domain="http://blogs.msdn.com/b/vcblog/archive/tags/64_2D00_bit/">64-bit</category><category domain="http://blogs.msdn.com/b/vcblog/archive/tags/C_2B002B00_/">C++</category><category domain="http://blogs.msdn.com/b/vcblog/archive/tags/VS2012/">VS2012</category></item><item><title>Developing an app with the Visual Studio 3D Starter Kit, part 3 of 3</title><link>http://blogs.msdn.com/b/vcblog/archive/2013/04/11/developing-an-app-with-the-visual-studio-3d-starter-kit-part-3-of-3.aspx</link><pubDate>Thu, 11 Apr 2013 23:30:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10405540</guid><dc:creator>Roberto Sonnino - MSFT</dc:creator><slash:comments>4</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/vcblog/rsscomments.aspx?WeblogPostID=10405540</wfw:commentRss><comments>http://blogs.msdn.com/b/vcblog/archive/2013/04/11/developing-an-app-with-the-visual-studio-3d-starter-kit-part-3-of-3.aspx#comments</comments><description>&lt;p&gt;Welcome back to our third and final post on using the &lt;a href="http://aka.ms/vs3dkit"&gt;Visual Studio 3D Starter Kit&lt;/a&gt;! If you read our previous posts in this series (&lt;a href="http://blogs.msdn.com/b/vcblog/archive/2013/03/26/developing-an-app-with-the-visual-studio-3d-starter-kit-part-1-of-3.aspx"&gt;here&lt;/a&gt; and &lt;a href="http://blogs.msdn.com/b/vcblog/archive/2013/04/02/developing-an-app-with-the-visual-studio-3d-starter-kit-part-2-of-3.aspx"&gt;here&lt;/a&gt;), you&amp;rsquo;ve got an app that has an animated die, and you&amp;rsquo;re ready to make the last few changes to get this app to run on Windows RT devices&amp;nbsp;and Windows Phone 8.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you haven&amp;rsquo;t read the previous posts, you may want to go through these posts and create an app &amp;ndash; we&amp;rsquo;ll be here once you&amp;rsquo;re ready.&lt;/p&gt;
&lt;p&gt;If you're more of a visual learner, you might prefer following Part 1 and 2 in our new &lt;a href="http://channel9.msdn.com/posts/VS-3D-Starter-Kit-Dice-Roller"&gt;Channel 9 video&lt;/a&gt;! In less than 30 minutes you'll go from&amp;nbsp;zero to jumping dice!&lt;/p&gt;
&lt;p&gt;&lt;a href="http://channel9.msdn.com/posts/VS-3D-Starter-Kit-Dice-Roller"&gt;&lt;img style="max-width: 512px;" src="http://media.ch9.ms/ch9/b3eb/05e328a7-8b3d-4e91-9085-e1241e46b3eb/DiceRollerrs_512.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Final steps for Windows RT&lt;/h2&gt;
&lt;p&gt;Since current Windows RT devices have a graphics card with &lt;a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ff476876.aspx"&gt;D3D_FEATURE_LEVEL_9_1&lt;/a&gt; and the Visual Studio Graphics tools generate shaders for graphics cards with D3D_FEATURE_LEVEL_10_0 and above, there&amp;rsquo;s one small extra step that has to be done for this app to run on Windows RT: we need to generate a version of the shaders to be compiled for the correct feature level.&lt;/p&gt;
&lt;p&gt;To do that, open your mesh (Die.fbx) and click the cube. On the Properties tool window look for a property called Effect. Click the &amp;ldquo;+&amp;rdquo; button to the left of that property and select the (Advanced) value. Finally, click the &amp;ldquo;&amp;hellip;&amp;rdquo; button to open the shader source for the Phong effect.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-69/6758.Part3_5F00_Fig1.png"&gt;&lt;img src="http://blogs.msdn.com/resized-image.ashx/__size/391x366/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-69/6758.Part3_5F00_Fig1.png" alt="" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;What you see now is the default&amp;nbsp;shader that Visual Studio applied to this mesh, displayed in the Visual Studio Shader Designer. The Shader Designer allows you to build complex visual effects without the need to learn a new programming language. To learn more about the Shader Designer, check the &lt;a href="http://msdn.microsoft.com/en-us/library/hh315733(v=VS.110).aspx"&gt;documentation&lt;/a&gt; and &lt;a href="http://msdn.microsoft.com/en-us/library/jj161095.aspx"&gt;walkthrough&lt;/a&gt; on MSDN.&lt;/p&gt;
&lt;p&gt;What we want to do with this shader is export it to HLSL in order to be able to re-compile it for Direct3D Feature Level 9 graphics cards. The Starter Kit will automatically look for a fallback shader with the same name as the original in case the device does not support D3D Feature Level 10 or higher.&lt;/p&gt;
&lt;p&gt;To export this shader, go to the last icon in the toolbar (Advanced) -&amp;gt; Export -&amp;gt; Export as&amp;hellip; (see figure below) and save it as &amp;ldquo;&lt;strong&gt;Phong.hlsl&lt;/strong&gt;&amp;rdquo; in your Assets folder. Then, add the file to the project by right-clicking the Assets folder on Solution Explorer -&amp;gt; Add -&amp;gt; Existing item&amp;hellip; and selecting the file we just exported.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-69/0842.Part3_5F00_Fig2.png"&gt;&lt;img src="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-69/0842.Part3_5F00_Fig2.png" alt="" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Finally, we need to tell the HLSL compiler that this file is a Pixel Shader. To do that, right-click &amp;ldquo;Phong.hlsl&amp;rdquo; on your Solution Explorer and choose Properties. On the Properties page, make sure the &amp;ldquo;Configuration&amp;rdquo; drop down is set to &amp;ldquo;All Configurations&amp;rdquo; and the &amp;ldquo;Platform&amp;rdquo; drop down is set to &amp;ldquo;All Platforms&amp;rdquo;, so that the changes we make are applied to all versions of our app.&lt;/p&gt;
&lt;p&gt;Then, on the &amp;ldquo;HLSL Compiler&amp;rdquo; page, change the Shader Type property to &amp;ldquo;Pixel Shader (/ps)&amp;rdquo; and make sure to enable optimizations (set the Disable optimizations property to "No"), like the figure below:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-69/7181.Part3_5F00_Fig3.png"&gt;&lt;img src="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-69/7181.Part3_5F00_Fig3.png" alt="" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;With this step, everything is ready for Windows RT. This app can now be deployed to your favorite device using the &lt;a href="http://msdn.microsoft.com/en-us/library/windows/apps/hh441469(v=vs.110).aspx"&gt;Visual Studio Remote Debugging Tools&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Another change you should make before releasing the app for Windows RT is to make sure snap view and portrait mode work as expected. In this case, all we did was to make sure the camera stayed on the same orientation when we change the view, by deleting the following line on the CreateWindowSizeDependentResource()&amp;nbsp;method on&amp;nbsp;Game.cpp:&lt;/p&gt;
&lt;pre style="background: white; color: black; font-family: Consolas;"&gt;&lt;span style="color: blue;"&gt;void&lt;/span&gt;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;Game&lt;/span&gt;::CreateWindowSizeDependentResources()
{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #2b91af;"&gt;GameBase&lt;/span&gt;::CreateWindowSizeDependentResources();
 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: green;"&gt;//&amp;nbsp;(snip) Initialize camera...&lt;/span&gt;
&lt;/pre&gt;
&lt;pre style="background: white; color: black; font-family: Consolas;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;if&lt;/span&gt;&amp;nbsp;(aspectRatio&amp;nbsp;&amp;lt;&amp;nbsp;1.0f)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: green;"&gt;///&lt;/span&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: green;"&gt;///&amp;nbsp;portrait&amp;nbsp;or&amp;nbsp;snap&amp;nbsp;view&lt;/span&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: green;"&gt;///&lt;/span&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="text-decoration: line-through; background-color: #ffc5e2;"&gt;m_graphics.GetCamera().SetUpVector(&lt;span style="color: #2b91af; text-decoration: line-through;"&gt;XMFLOAT3&lt;/span&gt;(1.0f,&amp;nbsp;0.0f,&amp;nbsp;0.0f)); &lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/pre&gt;
&lt;pre style="background: white; color: black; font-family: Consolas;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fovAngleY&amp;nbsp;=&amp;nbsp;120.0f&amp;nbsp;*&amp;nbsp;XM_PI&amp;nbsp;/&amp;nbsp;180.0f;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
&lt;/pre&gt;
&lt;pre style="background: white; color: black; font-family: Consolas;"&gt;&lt;span style="color: green;"&gt; //&amp;nbsp;(snip) Lights...&lt;/span&gt;&lt;br /&gt;}
&lt;/pre&gt;
&lt;p&gt;You can download the project at this state on &lt;a href="http://diceroller3d.codeplex.com/SourceControl/changeset/5ebb20f0b93447d14d615508b3d8df7f57d683d7"&gt;CodePlex&lt;/a&gt;&amp;nbsp;(direct download link below).&lt;/p&gt;
&lt;p&gt;&lt;a href="http://download-codeplex.sec.s-msft.com/Download/SourceControlFileDownload.ashx?ProjectName=diceroller3d&amp;amp;changeSetId=5ebb20f0b934"&gt;&lt;img src="http://blogs.msdn.com/resized-image.ashx/__size/150x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-69/1541.SupportForRT.png" alt="" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Porting it to the Windows Phone&lt;/h2&gt;
&lt;p&gt;Using the &lt;a href="http://aka.ms/vs3dkit"&gt;Starter Kit with support for Windows Phone&lt;/a&gt;, porting this app to Windows Phone 8 is a breeze. All you have to do is get the Starter Kit, replace the Game.cpp and Game.h classes by the ones you created for this app, add all your assets (in this case, Die.fbx, DieTexture.png and Phong.hlsl), and change the XAML codebehind to call RollDie() when the screen is tapped. Let&amp;rsquo;s go over this in a short step by step:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Make sure you have the &lt;a href="http://dev.windowsphone.com/en-us/downloadsdk"&gt;Windows Phone 8 SDK&lt;/a&gt; installed on your PC.&lt;/li&gt;
&lt;li&gt;Get the &lt;a href="http://aka.ms/vs3dkit"&gt;Visual Studio 3D Starter Kit with support for Windows Phone&lt;/a&gt; and open it in Visual Studio.&lt;/li&gt;
&lt;li&gt;In the StarterKitPhoneComponent project, delete the Shared/Animation folder and delete all the assets from the Shared/Assets folder.&lt;/li&gt;
&lt;li&gt;Replace the Game.cpp and Game.h files by the ones you created in this tutorial.&lt;/li&gt;
&lt;li&gt;Add all the assets used in your game to the Shared/Assets folder in the StarterKitPhoneComponent project: Die.fbx, DieTexture.png and Phong.hlsl.&lt;/li&gt;
&lt;li&gt;For Phong.hlsl, on the Properties page, make sure the &amp;ldquo;Configuration&amp;rdquo; drop down is set to &amp;ldquo;All configurations&amp;rdquo; and the &amp;ldquo;Platform&amp;rdquo; drop down is set to &amp;ldquo;All Platforms&amp;rdquo;. Then, on the &amp;ldquo;HLSL Compiler&amp;rdquo; page, change the Shader Type property to &amp;ldquo;Pixel Shader (/ps)&amp;rdquo; and set the Disable optimizations property to &amp;rdquo;No&amp;rdquo;.&lt;/li&gt;
&lt;li&gt;In Direct3DBackground.cpp/.h, remove the unused methods: ToggleHitEffect() and ChangeMaterialColor()&lt;/li&gt;
&lt;li&gt;In Direct3DBackground.cpp, add the following to the OnPointerReleased() method:
&lt;pre style="background: white; color: black; font-family: Consolas;"&gt;&lt;span style="color: blue;"&gt;void&lt;/span&gt;&amp;nbsp;Direct3DBackground::OnPointerReleased(DrawingSurfaceManipulationHost^&amp;nbsp;sender,&amp;nbsp;PointerEventArgs^&amp;nbsp;args)
{
	&lt;span style="background-color: #00ffff;"&gt;m_renderer-&amp;gt;RollDie();&lt;/span&gt;
}&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;On MainPage.xaml, remove all XAML related to the counters and app bar.&lt;/li&gt;
&lt;li&gt;On MainPage.xaml.cs, remove all unused fields and methods.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Done! You can now run this app on the Windows Phone emulator or on your Windows Phone 8 device. You may want to tweak the camera position and field of view to get a bigger die on your phone screen.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-69/0361.DiceRollerPhone.png"&gt;&lt;img src="http://blogs.msdn.com/resized-image.ashx/__size/200x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-69/0361.DiceRollerPhone.png" alt="" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;You can download the final project on &lt;a href="http://diceroller3d.codeplex.com/SourceControl/changeset/78429aedf85e34b4e3a9b41c47ce219ceed9da91"&gt;CodePlex&lt;/a&gt; (direct download link below).&lt;/p&gt;
&lt;p&gt;&lt;a href="http://download-codeplex.sec.s-msft.com/Download/SourceControlFileDownload.ashx?ProjectName=diceroller3d&amp;amp;changeSetId=78429aedf85e"&gt;&lt;img src="http://blogs.msdn.com/resized-image.ashx/__size/150x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-65-69/1854.FinalProject.png" alt="" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;For the future&lt;/h2&gt;
&lt;p&gt;This app is now complete, but there&amp;rsquo;s still a lot that can be done to make it shine on the Windows Store. Here are some initial ideas:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Change the logo, tile icons and splash screen to match the app theme&lt;/li&gt;
&lt;li&gt;Create a cool background, and possibly a &amp;ldquo;table&amp;rdquo; where the die is resting&lt;/li&gt;
&lt;li&gt;Add shadows, reflections and other realistic visual effects&lt;/li&gt;
&lt;li&gt;Make the die customizable, translucent, or add rounded edges&lt;/li&gt;
&lt;li&gt;Make the app work with more than one die, or with dice with a different number of sides&lt;/li&gt;
&lt;li&gt;Add realistic physics elements, such as bouncing, force-based spinning, and collision detection&lt;/li&gt;
&lt;li&gt;Save the dice state when the app is suspended and restore afterwards&lt;/li&gt;
&lt;li&gt;Save the history of previous dice rolls&lt;/li&gt;
&lt;li&gt;Add sensor support to allow the dice to be rolled by shaking the device&lt;/li&gt;
&lt;li&gt;Add sound when the dice are rolled&lt;/li&gt;
&lt;li&gt;Use the dice roller to implement a board game or a casino simulator&amp;hellip;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Wrapping up&lt;/h2&gt;
&lt;p&gt;In this blog series you saw how to create a 3D app for Windows 8, Windows RT and Windows Phone with the Visual Studio 3D Starter Kit, sharing all the app logic and assets between all platforms. You also learned a little bit about the Visual Studio Graphics tools, and discovered that creating a 3D app is not a mysterious task &amp;ndash; you can start without a deep knowledge of 3D modeling, complex math and HLSL, and learn new concepts at your own pace.&lt;/p&gt;
&lt;p&gt;We&amp;rsquo;d love to hear feedback about this walkthrough, the Visual Studio 3D Starter Kit, or what you&amp;rsquo;d like to see in the future from Visual Studio for graphics development.&amp;nbsp; Leave us a note in the comments!&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Very special thanks to Jennifer Leaf for co-authoring the articles and beta-testing the code. Special thanks to Golnaz Alibeigi for all the help with the video, and Bruno Sonnino and Eric Battalio for reviewing the blog posts.&lt;/em&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10405540" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/vcblog/archive/tags/Direct3D/">Direct3D</category><category domain="http://blogs.msdn.com/b/vcblog/archive/tags/DirectX/">DirectX</category><category domain="http://blogs.msdn.com/b/vcblog/archive/tags/Games/">Games</category><category domain="http://blogs.msdn.com/b/vcblog/archive/tags/C_2B002B00_/">C++</category><category domain="http://blogs.msdn.com/b/vcblog/archive/tags/windows+8/">windows 8</category><category domain="http://blogs.msdn.com/b/vcblog/archive/tags/Windows+Store+Apps/">Windows Store Apps</category><category domain="http://blogs.msdn.com/b/vcblog/archive/tags/3D+Starter+Kit/">3D Starter Kit</category></item><item><title>Profile Guided Optimization (PGO)</title><link>http://blogs.msdn.com/b/vcblog/archive/2013/04/08/profile-guided-optimization-pgo.aspx</link><pubDate>Mon, 08 Apr 2013 16:21:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10409379</guid><dc:creator>Ankit Asthana</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/vcblog/rsscomments.aspx?WeblogPostID=10409379</wfw:commentRss><comments>http://blogs.msdn.com/b/vcblog/archive/2013/04/08/profile-guided-optimization-pgo.aspx#comments</comments><description>&lt;p&gt;&lt;strong&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/e7k32f4k(v=vs.80).aspx"&gt;PGO&lt;/a&gt;&lt;/strong&gt;&lt;span style="color: #424242;"&gt; is a runtime compiler optimization which leverages profile data collected from running important and performance centric user scenarios to build an optimized version of the application. PGO optimizations have some significant advantage over traditional static optimizations as they are based upon how the application is likely to perform in a production environment which allow the optimizer to optimize for speed for hotter code paths (common user scenarios) and optimize for size for colder code paths (not so common user scenarios) resulting in generating faster and smaller code for the application attributing to significant performance gains. &lt;/span&gt;&lt;/p&gt;
&lt;h2&gt;Getting Started&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://blogs.msdn.com/b/vcblog/archive/2013/04/04/how-to-build-faster-and-high-performing-native-applications-using-pgo.aspx"&gt;How to build faster and high performing applications with PGO&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/xct6db7f(v=vs.80).aspx"&gt;PGO Walkthrough&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;[To be published April/2013: PGO under the hood and case studies]&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Best Practices&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;[To be published April/2013: PGO best practices, tips and tricks]&lt;/li&gt;
&lt;li&gt;[To be published April/2013: How to analyze your training scenarios when using PGO]&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Video Resources&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.youtube.com/watch?v=zEsdBcu4R00"&gt;Profile Guided Optimization under the hood&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://channel9.msdn.com/Shows/C9-GoingNative/C9GoingNative-12-C-at-BUILD-2012-Inside-Profile-Guided-Optimization"&gt;GoingNative 12: C++ at Build 2012, Inside Profile Guided&amp;nbsp;Optimization&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Community&lt;/h2&gt;
&lt;p&gt;Learn more about PGO, C++ and related developer and technical topics on the community. We are fortunate to have many vibrant communities and hundreds of smart, helpful members willing to engage.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Follow the Visual C++ team on &lt;a href="http://www.facebook.com/pages/Microsoft-Visual-Cpp/222043184527264" target="_blank"&gt;Facebook&lt;/a&gt; and &lt;a href="https://twitter.com/visualc" target="_blank"&gt;Twitter&lt;/a&gt; for tips, tricks, updates, links, questions and other information.&lt;/li&gt;
&lt;li&gt;Ask questions (and see what other folks have asked) on the &lt;a href="http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/threads" target="_blank"&gt;MSDN forums&lt;/a&gt; or &lt;a href="http://stackoverflow.com/questions/tagged/c%2b%2b" target="_blank"&gt;Stack Overflow&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;span style="color: #333333;"&gt;See what Microsoft &lt;a href="http://mvp.microsoft.com/en-us/search-mvp.aspx?ty=a&amp;amp;ex=Visual+C%2B%2B" target="_blank"&gt;C++ MVPs&lt;/a&gt; are up to.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;Attend a local user group meeting. Attend a conference like &lt;a href="http://www.buildwindows.com/" target="_blank"&gt;//build/&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Ping &lt;a href="mailto:aasthan@microsoft.com"&gt;Ankit Asthana&lt;/a&gt; (PGO PM) directly with questions, comments, ideas for future content and any other feedback you might have.&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;&amp;nbsp;&lt;/h2&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10409379" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/vcblog/archive/tags/PGO/">PGO</category></item></channel></rss>