{"id":890,"date":"2011-01-17T18:35:16","date_gmt":"2011-01-17T17:35:16","guid":{"rendered":"http:\/\/blog.eweibel.net\/?p=890"},"modified":"2011-01-17T18:35:16","modified_gmt":"2011-01-17T17:35:16","slug":"hunting-performance-issues","status":"publish","type":"post","link":"https:\/\/blog.eweibel.net\/?p=890","title":{"rendered":"Hunting performance issues"},"content":{"rendered":"<p><a href=\"http:\/\/blog.eweibel.net\/wp-content\/uploads\/image9.png\"><img loading=\"lazy\" decoding=\"async\" style=\"border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px\" title=\"image\" border=\"0\" alt=\"image\" align=\"right\" src=\"http:\/\/blog.eweibel.net\/wp-content\/uploads\/image_thumb9.png\" width=\"217\" height=\"233\" \/><\/a>Recently I received the lead over a performance optimization project for a software product.&#160; It isn&#8217;t something extraordinary for a software architect, because as a software architect you have to know what&#8217;s critical for a software system in a specific environment.     <br \/>Some of my co-workers may now smile a bit: I always say that you shouldn&#8217;t by default design your software based on performance considerations. The code should be simple, understandable and correct. My thesis was and is &quot;good code is fast code&quot;. With this new job I have the chance to proof this thesis.     <br \/>So I started to plan my work and tried to achieve a performance improvement of the related software. This blog post is a temporary r\u00e9sum\u00e9 what I learned so far.<\/p>\n<p><strong>Feedback from the users of the software<\/strong>     <br \/>My first task was to visit the users and talk with them about where they think exactly the performance problems are. As expected the feedback was quite on a high level of abstraction. They told me where in the processes the software seems to be slow. The feedback was, as expected, subjective and also colored by the business of the customer. Not all customers use the software the same way or use the same set of features. But after an analysis of log files and other resources I could, in many times, prove the customer feedback.<\/p>\n<p><strong>Feedback from the IT departments<\/strong>     <br \/>I received not only feedback from the users, there was also feedback from system administrators as well. And this feedback was sometimes a little bit scary: 100% CPU usage over several minutes, heavy use of RAM. The only thing what a system administrator can do in such a situation is to ask the users if he could reset the IIS or reboot the server. At this point every software developer understands why performance is important. It isn&#8217;t only about money, it is also about customer satisfaction.<\/p>\n<p><strong>Tools<\/strong>     <br \/>When you have to improve your software performance, then you need facts. Those facts can be log entries, code smells or discovered facts by dynamic code analysis tools. In the software which I have to improve, there was a log, but the components of the software didn&#8217;t log very performance specific. So I was more or less blind. This was the reason why I began to evaluate profiling software. At the end there were two profilers: <a href=\"http:\/\/www.jetbrains.com\/profiler\/\" target=\"_blank\">JetBrains dotTrace<\/a> and <a href=\"http:\/\/www.red-gate.com\/products\/dotnet-development\/dotnet-developer-bundle\/\" target=\"_blank\">Red Gate ANTS Profiler<\/a>. I chose the Red Gate profiler because I found the UI and the presented information a bit better. So, the current tools I use are:<\/p>\n<ul>\n<li>Several SQL statements to get information out of the database <\/li>\n<li>Execution plan in the SQL Management Studio <\/li>\n<li>Handmade log analyzer <\/li>\n<li><a href=\"http:\/\/www.red-gate.com\/products\/dotnet-development\/ants-performance-profiler\/\" target=\"_blank\">ANTS Performance Profiler<\/a> <\/li>\n<li><a href=\"http:\/\/www.red-gate.com\/products\/dotnet-development\/ants-memory-profiler\/\" target=\"_blank\">ANTS Memory Profiler<\/a> <\/li>\n<li><a href=\"http:\/\/memprofiler.com\/\" target=\"_blank\">Trial version of the .Net Memory Profiler<\/a> <\/li>\n<li><a href=\"http:\/\/technet.microsoft.com\/en-us\/sysinternals\/default\" target=\"_blank\">Microsoft Sysinternals tools<\/a> <\/li>\n<\/ul>\n<p>The Sysinternals tools and the trial version of the .Net Memory Profiler I used to understand why the software consumes that much memory. But I discovered just little things, which you can find by a code review or by a static code analysis tool as well.<\/p>\n<p><strong>Methods<\/strong>     <br \/>After a week I asked myself if I do job right (efficiency) and if I do the right things (effectiveness). So I looked for techniques how to find performance issues in software (books, blogs, etc.). Unfortunately I didn&#8217;t find any interesting sources until now.<\/p>\n<p><strong>Conclusion<\/strong>     <br \/>One thing I learned was, that you should never optimize code without facts. Too often I got results from the profiler which were surprising. Without those results (facts) I would have optimized the wrong part in the code. But sometimes the code is obviously bad, so that you don&#8217;t need a profiler to proof that the code could be faster. So, currently my thesis &quot;Good code is fast code&quot; seems to be true.     <br \/>During the discussions with the users and the customers I realized, that there weren&#8217;t any non functional requirements specified. But this isn&#8217;t a good thing neither for the software company nor for the customer. At the end, the only thing that counts, is customer satisfaction.     <br \/>The next steps are to improve the effectiveness to find performance issues and to define some preventions to increase the code quality. That includes some teaching about <a href=\"http:\/\/en.wikipedia.org\/wiki\/You_ain%27t_gonna_need_it\" target=\"_blank\">YAGNI<\/a>, <a href=\"http:\/\/en.wikipedia.org\/wiki\/Don%27t_repeat_yourself\" target=\"_blank\">DRY<\/a> and <a href=\"http:\/\/en.wikipedia.org\/wiki\/KISS_principle\" target=\"_blank\">KISS<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Recently I received the lead over a performance optimization project for a software product.&#160; It isn&#8217;t something extraordinary for a software architect, because as a software architect you have to know what&#8217;s critical for a software system in a specific environment. Some of my co-workers may now smile a bit: I always say that you shouldn&#8217;t by default design your software based on performance considerations. The code should be simple, understandable and correct. My thesis was and is &quot;good code&#8230;<\/p>\n<p class=\"read-more\"><a class=\"btn btn-default\" href=\"https:\/\/blog.eweibel.net\/?p=890\"> Read More<span class=\"screen-reader-text\">  Read More<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[4,14],"tags":[],"class_list":["post-890","post","type-post","status-publish","format-standard","hentry","category-software-architecture","category-software-engineering"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/plOV9-em","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":1014,"url":"https:\/\/blog.eweibel.net\/?p=1014","url_meta":{"origin":890,"position":0},"title":"Master of Advanced Studies in Information Technology","author":"Patrick","date":"9. May 2011","format":false,"excerpt":"During the last three years I was a part-time student again because I did at the university of applied science in Berne a post-grade study. Last week I received my certificate and the new title on the CV is now \u201cMaster of Advanced Studies in Information Technology\u201d. I chose the\u2026","rel":"","context":"In &quot;Private&quot;","block_context":{"text":"Private","link":"https:\/\/blog.eweibel.net\/?cat=9"},"img":{"alt_text":"image","src":"https:\/\/i0.wp.com\/blog.eweibel.net\/wp-content\/uploads\/image_thumb16.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":1121,"url":"https:\/\/blog.eweibel.net\/?p=1121","url_meta":{"origin":890,"position":1},"title":"Speaking at the .NET Usergroup Bern","author":"Patrick","date":"4. Dec 2011","format":false,"excerpt":"During a Lunch event organized by the .NET Usergroup Bern at the 7 December 2011 in Bern I will speak about the following question: Is Software design overrated? Yes, I know, it's provocative. And obviously wrong. Really? I'm not so sure. After 10 years as software engineer and some years\u2026","rel":"","context":"In &quot;Design patterns&quot;","block_context":{"text":"Design patterns","link":"https:\/\/blog.eweibel.net\/?cat=3"},"img":{"alt_text":"image","src":"https:\/\/i0.wp.com\/blog.eweibel.net\/wp-content\/uploads\/image_thumb18.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":718,"url":"https:\/\/blog.eweibel.net\/?p=718","url_meta":{"origin":890,"position":2},"title":"Do frameworks kill design skills?","author":"Patrick","date":"8. Feb 2011","format":false,"excerpt":"Software design is one of the most important skills a software engineer should have. But what is software design exactly? If you search for a definition you find something like this: Software design is a process of problem-solving and planning for a software solution. After the purpose and specifications of\u2026","rel":"","context":"In &quot;Design patterns&quot;","block_context":{"text":"Design patterns","link":"https:\/\/blog.eweibel.net\/?cat=3"},"img":{"alt_text":"image","src":"https:\/\/i0.wp.com\/blog.eweibel.net\/wp-content\/uploads\/image_thumb11.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":1167,"url":"https:\/\/blog.eweibel.net\/?p=1167","url_meta":{"origin":890,"position":3},"title":"Who should make decisions about technologies?","author":"Patrick","date":"13. Feb 2012","format":false,"excerpt":"One of the biggest problems of software engineering companies in Switzerland is currently to get new software developers. To get new employees there are several points as for example salary, environment, career possibilities and technologies. The last point looks easy but in reality it isn't that easy. Why are essential\u2026","rel":"","context":"In &quot;New technology&quot;","block_context":{"text":"New technology","link":"https:\/\/blog.eweibel.net\/?cat=6"},"img":{"alt_text":"Stay on course","src":"https:\/\/i0.wp.com\/blog.eweibel.net\/wp-content\/uploads\/Fotolia_36561464_S_thumb.jpg?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":1033,"url":"https:\/\/blog.eweibel.net\/?p=1033","url_meta":{"origin":890,"position":4},"title":"Data quality as a business value","author":"Patrick","date":"3. Jun 2011","format":false,"excerpt":"It could happen, that you have to do some data migrations from time to time. If you are familiar with data migrations you know that it isn\u2019t an easy job. There are several concerns: Needed time to do the effective migration Cleaning up data Validate current data (consistency) Transform existing\u2026","rel":"","context":"In &quot;Software engineering&quot;","block_context":{"text":"Software engineering","link":"https:\/\/blog.eweibel.net\/?cat=14"},"img":{"alt_text":"DataQuality","src":"https:\/\/i0.wp.com\/blog.eweibel.net\/wp-content\/uploads\/DataQuality_thumb.jpg?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":281,"url":"https:\/\/blog.eweibel.net\/?p=281","url_meta":{"origin":890,"position":5},"title":"VB-stereotype: Are there programmers who fit any more?","author":"Patrick","date":"29. Jun 2009","format":false,"excerpt":"I saw recently the talk \"Comparing Java Web Framworks\" on Parleys.com and when the speaker talks about JSF, he used the word \"VB\". I was a little bit surprised, that also in the java world the VB-stereotype is known. But what about is this VB-stereotype? Are there programmers who fit\u2026","rel":"","context":"In &quot;.NET&quot;","block_context":{"text":".NET","link":"https:\/\/blog.eweibel.net\/?cat=13"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/blog.eweibel.net\/index.php?rest_route=\/wp\/v2\/posts\/890","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.eweibel.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.eweibel.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.eweibel.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.eweibel.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=890"}],"version-history":[{"count":18,"href":"https:\/\/blog.eweibel.net\/index.php?rest_route=\/wp\/v2\/posts\/890\/revisions"}],"predecessor-version":[{"id":911,"href":"https:\/\/blog.eweibel.net\/index.php?rest_route=\/wp\/v2\/posts\/890\/revisions\/911"}],"wp:attachment":[{"href":"https:\/\/blog.eweibel.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=890"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.eweibel.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=890"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.eweibel.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=890"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}