Top free tools for tacklingASP.NET Performance
Ben Emmett – KCDC – 16 May 2014
Titanium Sponsors
Platinum Sponsors
Gold Sponsors
A simple page
DNS
Init
Client wait
Server processing
ReceiveLayout / render
Req html
Go Finished!
<html> <head> <title>A web page</title>
</head> <body> <p id=“greeting”> Hello Kansas! </p> </body></html>
index.html
A stylish page
DNS
Init
Client wait
Server processing
ReceiveLayout / render
Req html
Go Finished!
Req css
body { background-color : #123456;}
p { font-weight : bold;}
stylish.css<html> <head> <title>A web page</title>
<link href=“/stylish.css” type=“text/css” /> </head> <body> <p id=“greeting”> Hello Kansas! </p> </body></html>
index.html
A responsive page
DNS
Init
Client wait
Server processing
<html> <head> <title>A web page</title> <script src=“/responsive.js” type=“text/javascript”></script> <link href=“/stylish.css” type=“text/css” /> </head> <body> <p id=“greeting”> Hello Kansas! </p> </body></html>
ReceiveLayout / render
Req html
Go Finished!
body { background-color : #123456;}
p { font-weight : bold;}
index.html stylish.css
Req js
responsive.jsalertMessage = function(){ alert("Hello!");}
document.getElementById("greeting").onClick = alertMessage;
Req css
It’s slower than thatClient Server
SYN
SYN-ACK
ACK
Request
Response
pt1ACK
Response
pt2
ACK
Response
pt3
Retrieve a 35kb fileRound trip # Purpose Data received Running total
1 TCP handshake -- 0kb
2 Receive 1st chunk 2kb 2kb
3 Receive 2nd chunk 4kb 6kb
4 Receive 3rd chunk 8kb 14kb
5 Receive 4th chunk 16kb 30kb
6 Receive 5th chunk 5kb 35kb
Where are the bottlenecks?
• Latency
• Bandwidth
• Server processing
• Rendering
And when do they matter?
#4
chrome
canary
www.google.co.uk/intl/en/chrome/browser/canary.html
#5
PageSpeeddevelopers.google.com/speed/pagespeed
Some bonus super-easy wins
Use a CDN:Provided by GoogleProvided by Microsoft
Optimize images:Image Optimizer Visual Studio extension
Minimize & combine:Web Essentials Visual Studio extension
Wrapping up
• Make sure you’re getting the easy wins
• Always have half an eye on performance
• No premature optimization!