<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB"><title type="html">Richard Florance's Solution Performance blog </title><subtitle type="html">Everything and anything about making Solutions run faster and more efficiently...</subtitle><id>http://blogs.msdn.com/flo/atom.xml</id><link rel="alternate" type="text/html" href="http://blogs.msdn.com/flo/default.aspx" /><link rel="self" type="application/atom+xml" href="http://blogs.msdn.com/flo/atom.xml" /><generator uri="http://communityserver.org" version="2.1.61025.2">Community Server</generator><updated>2005-07-26T12:43:00Z</updated><entry><title>Easy wins tuning the performance of a web site</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/flo/archive/2008/06/17/easy-wins-tuning-the-performance-of-a-web-site.aspx" /><id>http://blogs.msdn.com/flo/archive/2008/06/17/easy-wins-tuning-the-performance-of-a-web-site.aspx</id><published>2008-06-17T12:44:00Z</published><updated>2008-06-17T12:44:00Z</updated><content type="html">&lt;P class=MsoListParagraphCxSpFirst style="MARGIN: 0cm 0cm 0pt 36pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1"&gt;&lt;FONT face=Calibri size=3&gt;I've been on several ASP.Net web site projects over the last couple of yeras doing performance analysis and I've found that every time there is a common series of quick wins I've been able to make that can have a substantial effect on the responsiveness and scalability of web sites. It's now got to the point where I've written a list of things that I want the solution development team to check before I'll come and do any deeper analysis on the project. Here is the core list of work items I've come up with that you should look at first when tuning ASP.Net web sites:&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpFirst style="MARGIN: 0cm 0cm 0pt 36pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1"&gt;&lt;FONT face=Calibri size=3&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpFirst style="MARGIN: 0cm 0cm 0pt 36pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1"&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3&gt;·&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri size=3&gt;Turn on IIS Compression (this is off by default on IIS6 and IIS7). See here on how to do this:&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpFirst style="MARGIN: 0cm 0cm 0pt 36pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1"&gt;&lt;A href="http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/d52ff289-94d3-4085-bc4e-24eb4f312e0e.mspx?mfr=true"&gt;http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/d52ff289-94d3-4085-bc4e-24eb4f312e0e.mspx?mfr=true&lt;/A&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpMiddle style="MARGIN: 0cm 0cm 0pt 36pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1"&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3&gt;·&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri size=3&gt;Turn on IIS content Expiry (again this is off by default). See here:&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpMiddle style="MARGIN: 0cm 0cm 0pt 36pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1"&gt;&lt;A href="http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/0fc16fe7-be45-4033-a5aa-d7fda3c993ff.mspx?mfr=true"&gt;http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/0fc16fe7-be45-4033-a5aa-d7fda3c993ff.mspx?mfr=true&lt;/A&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpMiddle style="MARGIN: 0cm 0cm 0pt 36pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1"&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3&gt;·&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri size=3&gt;Merge static content into as few files as possible (e.g. only have one .js file and .css file). It is faster to download one big file that several smaller ones over the internet.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpMiddle style="MARGIN: 0cm 0cm 0pt 36pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1"&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3&gt;·&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri size=3&gt;Enable ASP.Net output caching where possible. You need to look at this on a page by page basis but can give huge wins for pages that contain mostly static content. See here: &lt;/FONT&gt;&lt;A href="http://support.microsoft.com/kb/323290"&gt;http://support.microsoft.com/kb/323290&lt;/A&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpMiddle style="MARGIN: 0cm 0cm 0pt 36pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1"&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3&gt;·&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri size=3&gt;Enable Web service output caching where possible. If you have any public web services that only return a limited or predictable range of values based on their input parameters you should look at this. See Here: &lt;/FONT&gt;&lt;A href="http://support.microsoft.com/kb/318299"&gt;http://support.microsoft.com/kb/318299&lt;/A&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpMiddle style="MARGIN: 0cm 0cm 0pt 36pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1"&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3&gt;·&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri size=3&gt;If your Site makes web service calls, increase MaxConnections in the Machine.config to handle the level of concurrency you want to support. See: "Threading Explained" here: &amp;nbsp;&lt;A href="http://msdn.microsoft.com/en-us/library/ms998549.aspx#scalenetchapt06_topic8"&gt;&lt;FONT face=Calibri color=#0000ff size=3&gt;http://msdn.microsoft.com/en-us/library/ms998549.aspx#scalenetchapt06_topic8&lt;/FONT&gt;&lt;/A&gt;. However don't take this as an absolute rule. For MaxConnections it is OK to go higher if your middle tier makes lots of long running Web service calls.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpMiddle style="MARGIN: 0cm 0cm 0pt 36pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1"&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3&gt;·&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri size=3&gt;Change the IIS threading configuration in machine.config to support better scaling. See: "Threading Explained" here: &amp;nbsp;&lt;/FONT&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/ms998549.aspx#scalenetchapt06_topic8"&gt;&lt;FONT face=Calibri color=#0000ff size=3&gt;http://msdn.microsoft.com/en-us/library/ms998549.aspx#scalenetchapt06_topic8&lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpMiddle style="MARGIN: 0cm 0cm 0pt 36pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1"&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3&gt;·&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri size=3&gt;Ensure ViewState is turned off where possible, and then only enable it for the controls that really need it. Viewstate can be huge and is on by default. turning off ViewState can radically reduce the size of pages you send over the wire. See here: &lt;A href="http://msdn.microsoft.com/en-us/library/ms972976.aspx#viewstate_topic9"&gt;http://msdn.microsoft.com/en-us/library/ms972976.aspx#viewstate_topic9&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpMiddle style="MARGIN: 0cm 0cm 0pt 36pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1"&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3&gt;·&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri size=3&gt;If you are using Ajax, ensure &amp;lt;compilation debug=”false”/&amp;gt; is set in your web config. This avoids very costly parameter validation on both the client and server. See "&lt;FONT size=2&gt;&lt;FONT face=Arial&gt;Significantly Better Debugging Support" in ScottGu'sblog here: &lt;A href="http://weblogs.asp.net/scottgu/archive/2006/10/20/ASP.NET-AJAX-Beta-1-Released.aspx"&gt;http://weblogs.asp.net/scottgu/archive/2006/10/20/ASP.NET-AJAX-Beta-1-Released.aspx&lt;/A&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpLast style="MARGIN: 0cm 0cm 10pt 36pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1"&gt;&lt;SPAN style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3&gt;·&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri size=3&gt;Run SQL Profiler against your database whilst doing normal activity, identify all SQL access that has high duration or CPU values and optimise them.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpFirst style="MARGIN: 0cm 0cm 0pt 36pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8610585" width="1" height="1"&gt;</content><author><name>Flo</name><uri>http://blogs.msdn.com/members/Flo.aspx</uri></author></entry><entry><title>Tracing gotchas</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/flo/archive/2005/08/22/454445.aspx" /><id>http://blogs.msdn.com/flo/archive/2005/08/22/454445.aspx</id><published>2005-08-22T12:03:00Z</published><updated>2005-08-22T12:03:00Z</updated><content type="html">&lt;P&gt;When I'm profiling solutions I work on, many times one of the first bottlenecks I&amp;nbsp;come across is&amp;nbsp;tracing code - even if tracing is currently turned off in the solution! The reason for this is how the solution checks to determine whether to generate tracing output.&lt;/P&gt;
&lt;P&gt;Everyone knows that tracing is expensive and should only be generated if you're currently trying to debug the solution, so the classic (very simple) pattern for implementing tracing is something like this:&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#000000 size=2&gt;if (TracingFlag == True)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#000000 size=2&gt;{&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#000000 size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;GenerateTracingOutput("It's all going wrong here");&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#000000 size=2&gt;}&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;The problem is where you go to get the value of "TracingFlag" and how often you get it. Invariably the value is stored as part of the solutions configuration somewhere, either in the registry or an XML config file, which is fine. What isn't fine is to reread this value from the registry or file every single time you need to determine whether or not to trace. The classic reasons for doing this are: Laziness, registry access is 'free' (yeah right) or I want to dynamically control tracing so I need to keep re-reading the value.&lt;/P&gt;
&lt;P&gt;Taking these in turn:&lt;/P&gt;
&lt;P&gt;Laziness - how hard is it to create a static variable to cache the tracing flag?&lt;/P&gt;
&lt;P&gt;Registry access is&amp;nbsp;'free' - Registry access isn't that fast. It requires a transition to the kernel and is protected by a global lock which means if all your threads are constantly reading the tracing flag they all end up getting serialised. You really need to read it once and cache that value.&lt;/P&gt;
&lt;P&gt;Dynamic tracing - From my experience being able to dynamically control tracing on a solution is a nice to have that is actually rarely used in the real world. However if you really need think you need it then don't reread it from source each time but read it once, cache it and then setup a ChangeNotificationRequest on the file or registry key so you can re-read the flag if&amp;nbsp;it&amp;nbsp;ever gets changed.&lt;/P&gt;
&lt;P&gt;Another classic performance hit with tracing is to implement a tracing class and then instantiate an instance of the class everytime you want to&amp;nbsp;check for tracing because the trace flag is a member of the class... Don't do it! Either make your tracing class a static class or instantiate an instance at startup and cache it.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=454445" width="1" height="1"&gt;</content><author><name>Flo</name><uri>http://blogs.msdn.com/members/Flo.aspx</uri></author></entry><entry><title>The relative speed of I/O</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/flo/archive/2005/08/12/450795.aspx" /><id>http://blogs.msdn.com/flo/archive/2005/08/12/450795.aspx</id><published>2005-08-12T14:47:00Z</published><updated>2005-08-12T14:47:00Z</updated><content type="html">&lt;P&gt;It still amazes me how often I come across dev's who have no appreciation of just how slow hard disks and networks actually are, especially when you compare their latency to the speed of your average Pentium processor. As a result they often break all my&amp;nbsp;golden rules and cause severe pain to their solutions because they have expectations that going to disk or network is relatively inexpensive.&lt;/P&gt;
&lt;P&gt;To try and give the person I was talking to a better perspective on just how slow I/O is, I looked up the relative latencies of current state of the art technologies and put together timelines based on the idea of 'if one CPU clock takes one second how long does X take'. Here is what I came up with:&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;Relative access frequencies of current state of the art:&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;CPU&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-tab-count: 2"&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; &lt;/SPAN&gt;3 GHz&lt;SPAN style="mso-tab-count: 2"&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; &lt;/SPAN&gt;(0.3ns - Current mainstream &lt;FONT color=#000000&gt;Intel&lt;/FONT&gt; Pentium IV clock speed)&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Memory&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;800 MHz&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;(1.25ns access time – the speed of fast DDR2 memory)&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;LAN&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&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;500 Hz &lt;SPAN style="mso-tab-count: 1"&gt;&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;(2ms - typical latency on a 1GHz LAN - I'm guessing a bit on this one but it seems reasonable)&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Disk&lt;SPAN style="mso-tab-count: 2"&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;/SPAN&gt;200 Hz&lt;SPAN style="mso-tab-count: 2"&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; &lt;/SPAN&gt;(5ms - disk seek time for an average random disk access)&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;WAN&lt;SPAN style="mso-tab-count: 2"&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;/SPAN&gt;25 Hz&lt;SPAN style="mso-tab-count: 2"&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;/SPAN&gt;(40ms- typical latency on US domestic Internet WAN link)&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;Translating these frequencies into numbers of CPU clock cycles gives:&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;1 Memory access = 4 CPU cycles&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;1 LAN access = 6,000,000 CPU cycles&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;1 Disk access = 15,000,000 CPU cycles&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;1 WAN access = 120,000,000 CPU cycles&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;FONT size=4&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=4&gt;Therefore &lt;FONT style="BACKGROUND-COLOR: #ffffff"&gt;if&lt;/FONT&gt;&amp;nbsp;one clock cycle on a 3GHz processor&amp;nbsp;takes 1 second then…&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=4&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;A memory access takes 3.75 seconds&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=4&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;A network round trip takes 69.4 days&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=4&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;A disk access takes 173.5 days&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=4&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Accessing an internet site takes 3.8 years!&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;This gives you a pretty good feeling for why caching just about everything is good for performance!&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=450795" width="1" height="1"&gt;</content><author><name>Flo</name><uri>http://blogs.msdn.com/members/Flo.aspx</uri></author></entry><entry><title>Golden rules for high performance solutions</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/flo/archive/2005/07/27/443872.aspx" /><id>http://blogs.msdn.com/flo/archive/2005/07/27/443872.aspx</id><published>2005-07-27T18:33:00Z</published><updated>2005-07-27T18:33:00Z</updated><content type="html">&lt;P&gt;Over the last three years I've analysed the performance of at least a dozen completely different solutions. However the performance bottlenecks I find&amp;nbsp;mostly tend to follow similar themes. Having analysed the types of issues that these bottlenecks are I believe I have distilled out three rules, that if&amp;nbsp;you follow them religiously, you are well on your way to having a solution that performs as well as possible in the environment that it is running. So without further ado here they are with a couple of examples of common issues that match each rule:&lt;/P&gt;&lt;FONT face=Arial&gt;
&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;
&lt;H2 style="MARGIN: 12pt 0in 3pt"&gt;&lt;EM&gt;Thou shalt never do anything more than once.&lt;/EM&gt;&lt;/H2&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;FONT face="Times New Roman" size=4&gt;Examples&lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Times New Roman" size=4&gt;Cache everything you are likely to use more than once. It is a cardinal sin to retrieve the same data from a SQL Server or a Web Service call twice.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Times New Roman" size=4&gt;Nothing is free – Never assume that anything you do doesn’t cost any time or resources. A classic example of this is accessing registry keys - especially tracing flags! When you're getting hardcore about performance tuning even memory allocation falls into this rule.&lt;/FONT&gt;&lt;/P&gt;
&lt;H2 style="MARGIN: 12pt 0in 3pt"&gt;&lt;EM&gt;Thou shalt not do anything you don’t need to.&lt;/EM&gt;&lt;/H2&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;FONT face="Times New Roman" size=4&gt;Examples&lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Times New Roman" size=4&gt;Don’t try and reuse an existing&amp;nbsp;stored procedure which returns tons of data when you only want one field that it returns – create a new stored procedure which just gets the data you need - you're unnecessarily burning CPU cycles and disk access on the SQL server and&amp;nbsp;hitting&amp;nbsp;network latency sucking the redundant data back to the calling tier.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Times New Roman" size=4&gt;Use stored procedures. Dynamic SQL generally causes SQL Server to repeatedly do a lot of unnecessary work with compilation and Execution plan generation.&lt;/FONT&gt;&lt;/P&gt;
&lt;H2 style="MARGIN: 12pt 0in 3pt"&gt;&lt;EM&gt;Thou shalt get everything in one go.&lt;/EM&gt;&lt;/H2&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;FONT face="Times New Roman" size=4&gt;Examples&lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Times New Roman" size=4&gt;Round trips, especially over a network or from a disk are expensive in latency.&amp;nbsp;Don’t use lots of fine grained web service calls when one chunky call can be used instead. Aim for one Web page = at most one web service call.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Times New Roman" size=4&gt;Don’t use several stored procedures to get a set of data. Create a new one which does everything and returns the complete result set. Aim for one Web Page\Web Service call = at most one SQL Server call.&lt;/FONT&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P dir=ltr&gt;&lt;/FONT&gt;&lt;FONT face="Times New Roman"&gt;These may sound obvious but you will be astounded at how often I see examples of these rules being broken and performance suffering (often radically!) as a result, usually because the developer is unaware of the impact of what he\she is calling, especially when you have a 100 users all calling the code concurrently...&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=443872" width="1" height="1"&gt;</content><author><name>Flo</name><uri>http://blogs.msdn.com/members/Flo.aspx</uri></author></entry><entry><title>Hello, good afternoon and welcome...</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/flo/archive/2005/07/26/443355.aspx" /><id>http://blogs.msdn.com/flo/archive/2005/07/26/443355.aspx</id><published>2005-07-26T14:43:00Z</published><updated>2005-07-26T14:43:00Z</updated><content type="html">&lt;P&gt;Seeing as this is my first blog I guess a good place to start is to tell you who I am, what I do and what pearls of wisdom I hope to impart in my blog.&lt;/P&gt;
&lt;P&gt;My name is Richard Florance, but a lot of people end up calling me Flo. I've been at Microsoft in the UK for longer than I care to&amp;nbsp;remember and spent&amp;nbsp;a&amp;nbsp;good while as a third line support engineer for Windows NT\2000 before moving over to become&amp;nbsp;a Consultant. However I've managed to create an interesting niche for myself as a performance specialist and I work mostly on customer solutions we develop&amp;nbsp;in house based on all our (usually) latest and greatest technology. Every now and again I'll go out and help customers on site when they're running into performance problems with their own solutions.&lt;/P&gt;
&lt;P&gt;I'll look at everything on a solution, from the scalability of the architecture to refining web page response times to tuning and optimising the business logic and to identifying poorly performing SQL queries. In this blog I'll talk about some of the interesting and common performance issues I've found along the way and discuss some of the tools I use. As we get close to shipping Visual Studio 2005 I hope to post some good stuff on the load testing tool and code profilers we are shipping as part of the product which are rapidly becoimg the main tools of my trade as they stabilise.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=443355" width="1" height="1"&gt;</content><author><name>Flo</name><uri>http://blogs.msdn.com/members/Flo.aspx</uri></author></entry></feed>