Upload
sergejus-barinovas
View
6.565
Download
2
Embed Size (px)
DESCRIPTION
Learn why it's crucial to optimize ASP.NET application performance and how to use various technics to reach 100 grade both in YSlow and Page Slow tools. Technics to be described: - tools: YSlow, Page Slow, Fiddler - javascript and css minification including related tools - image optimization and sprites including related tools - tuning IIS for performance - separating static content and using CDNs - ASP.NET server side profiling with MVC Profiler - client side profiling with Web Beacons and HTML5 Navigation Timing
Citation preview
Optimizing ASP.NET application performance: tough but necessarySergejus Barinovas
@sergejusb | [email protected]
My background
500M+ web requests per day
Why web performance is important?
Microsoft and Google research
• Microsoft Bing Search• With 500 ms delay revenue per user
dropped by 1.2%
• Google Search• With 400 ms delay number of users
leaving the page increased by 0.6%
Source: Performance Related Changes and their User Impact by Eric Schurman and Jake Brutlang
Performance is a feature and it costs
Mobile feedback appAgile Tour Vilnius 2011
Client side optimizationTough, but here are several hints for you…
Hint #1
• Understand your application• What is loaded• How much does it take
• Tools• Firefox Firebug• IE Developer Tools• Chrome Developer Tools
Hint #2
• Adhere to the web performance best practices• Yahoo! best practices for speeding up we
b site
• Google web performance best practices
• Tools• Yahoo! YSlow• Google Page Speed
Hint #3
• Perform advanced HTTP traffic debugging of headers, cookies, etc.
• Tool• Fiddler
Web performance rules (1/2)
• Minimize HTTP Requests• Combine JavaScript and CSS• Use CSS Sprites or inline images
• Put Stylesheets at the Top• Put Scripts at the Bottom• Make JavaScript and CSS External• Minify JavaScript and CSS• Optimize Images and CSS Sprites• Make favicon.ico Small and Cacheable
Web performance rules (2/2)
• Gzip Components• Add an Expires or a Max-Age• Configure ETags
Lets optimize mobile feedback app!
Demo: client side optimization
Tools to consider
• SquishIt library• Combine and minify your JavaScript and
CSS• ASP.NET 4.5 will have similar functionality
built-in• Image Optimizer plugin• Optimize PNG, GIF and JPEG files
• Sprite and Image Optimization library• Generate sprite image and related CSS
Other useful tools
• Visual Studio libraries• YUICompressor• AjaxMin
• JavaScript tools• Closure compiler• YUICompressor• AjaxMin• Packer• JSMin
• Image optimization• Smush.it• PunyPNG
• CSS tools• YUICompressor• AjaxMin• CSSTidy• Minify• CSSCompressor
Client side optimization results
Server side optimizationEven tougher and in most cases “it depends”…
Hint #1
• Within ASP.NET• Minimize usage of Session• Disable ViewState by default• Take control over Post Backs
• Within ASP.NET MVC• Minimize usage of Session• Disable unused View Engines• Remove URL Rewrite module
Hint #2
• Learn your most popular and slowest pages
• Tools• IIS logs and Microsoft Log Parser• ASP.NET MVC / WCF Mini Profiler• HTML5 Navigation Timing feature (IE, FF,
Chrome)
DemoLearning page usage and load times
Hint #3
• Minimize IIS footprint• Remove unused modules• Uninstall unused component
• Tool• Apache Bench
Worth knowing
• Maximum IIS throughput I’ve seen so far – 10 000 requests per second for static content• Removed all unused IIS components• Removed ASP.NET components• Tuned IIS caching options
Recap
• Performance is a feature and it costs
• Adhere to the web performance best
practices
• Learn page usage and load times
• Minimize IIS footprint
Now go and optimize you ASP.NET application performance!
Thank you! Questions?@sergejusb | [email protected]