SlideShare a Scribd company logo
1 of 109
ASP.NET Quick Wins
20 Tips and Tricks To Shift Your Application into High Gear
Kevin Griffin
twitter.com/1kevgriff
kevin@kevgriffin.com
Hello!
Kevin Griffin
Independent Consultant
Microsoft MVP, ASP.NET
kevin@kevgriffin.com
@1kevgriff
Now Accepting
Pre-Orders!
Special CodeMash Deal! Ends at
midnight Friday.
Get on email list!
$15 $39
http://TwilioBlueprint.com/Codemash
RevolutionConf
May 13th, 2016
Virginia Beach, VA
RevolutionConf.com
Want Slides? Conversation?
Let’s continue the conversation after Codemash!
Put your name and email address on the
clipboard, and I’ll send you a blast next week after
we have all had time to recover!
No spam, just conversation.
Defining Performance
Performance is the amount
of time a person will wait
before getting pissed off.
Performance is sweating
because you have ONLY 16
cores and 32 gigs of RAM.
The Great Scale of Performance
Done before you ask Throw Computer Out the Window
The Great Scale of Performance
Done before you ask Throw Computer Out the Window
ASP.NET Application After File, New
Google
Visual Studio
Why
Performance?
3 Numbers to
Remember
100
milliseconds
1 second
10 seconds
Did you know: Google will
rank a slower loading
website below a faster one.
The number of mobile device
users is growing by the daily.
They hate slow websites.
Two simple rules for
better performance
Fewer
payloads
Faster
payloads
20 ASP.NET Quick
Wins
#1
Disable “debug”
mode
#2
Enable HTTP
Compression
What gets compressed?
• HTML
• JavaScript
• JSON
• CSS
• XML
• Non-compressed images (ico)
#3
Enable IIS
Auto-Start
Do you have a lot of
upfront loading and
configuration?
#4
Disable ViewState
Ways to Disable
• Control
• Add EnableViewState=“false” to
control
• Page
• Add EnableViewState=“false” to
the <%@ Page %> construct
• Application
<configuration>
<system.web>
<pages enableViewState="false" />
</system.web>
</configuration>
• Machine
<Machine.config >
<system.web>
<pages enableViewState="false" />
</system.web>
</Machine.config>
#5
STOP using
WebForms
I’m just kidding.
But seriously,
stop it.
#6
Disable
SessionState
Ways to Disable
• Application • Page
#7
Throw hardware at it!
Stop it!
Processors are
cheap.
RAM is cheap.
#8
Minify/Compress
JavaScript and CSS
#9
Output Cache
Caching Options
• Duration (in seconds)
• Location
• Client
• Server
• Proxies
• VaryByParam
• VaryByHeader
• SqlDependency
#9b
Cache “look up”
tables
#10
Stop shipping the
kitchen sink
#11
Async
.NET Async Features
• Speeds up parallel processes
• Useful if your page needs to talk to several data sources
#12
CDNs and
Subdomains
CDNs and Subdomain
• Modern browsers limit downloads from a single domain.
http://assets.kevgriffin.com/images/2014/foo.png
could be better as
http://a1.assets.kevgriffin.com/images/2014/foo.png
#13
Glimpse
http://getglimpse.com
#14
Upgrade Your User
Experience
#15
ORM
Considerations
Test code-generated
“read” vs Stored
Procedures
Optimize for Ad Hoc
Queries
#16
Dispose SQL
Connections
Appropriately
#17
Hire a DBA to Optimize
Database Indexes and
Stored Procedures
Or if you must “do it yourself”
• Create indexes for columns used inside of:
• WHERE clauses
• JOIN clauses
• ORDER BY clauses
• GROUP clauses
• TOP clauses
Or if you must “do it yourself”
• Don’t do SELECT *
#18
Consider Alternative
Data Stores
Alternatives
• MongoDB
• RavenDB
• Redis
• Azure Tables
#19
Embrace Workflow
Workflow
•Message-based workflows
•Examples: RabbitMQ, ZeroMQ, Azure Queues, etc
•Offload long running and critical tasking
•Example: Twitter, Amazon
#20
Hire Me
Kevin Griffin
Independent Consultant
Microsoft MVP, ASP.NET
kevin@kevgriffin.com
@1kevgriff

More Related Content

What's hot

Capybara-Webkit
Capybara-WebkitCapybara-Webkit
Capybara-Webkit
bostonrb
 
Architecting single-page front-end apps
Architecting single-page front-end appsArchitecting single-page front-end apps
Architecting single-page front-end apps
Zohar Arad
 
WebFest 2011 WebMatrix Overview by Gavin Warrener
WebFest 2011 WebMatrix Overview by Gavin WarrenerWebFest 2011 WebMatrix Overview by Gavin Warrener
WebFest 2011 WebMatrix Overview by Gavin Warrener
Spiffy
 
Introduction To Single Page Application
Introduction To Single Page ApplicationIntroduction To Single Page Application
Introduction To Single Page Application
KMS Technology
 
Angular – Say Goodbye to Javascript Soup
Angular – Say Goodbye to Javascript SoupAngular – Say Goodbye to Javascript Soup
Angular – Say Goodbye to Javascript Soup
Graeme Foster
 

What's hot (20)

MJML presentation - PHP User group Sofia
 MJML presentation - PHP User group Sofia    MJML presentation - PHP User group Sofia
MJML presentation - PHP User group Sofia
 
ASP.NET Core
ASP.NET CoreASP.NET Core
ASP.NET Core
 
How to Automate Practically Anything with FME Server (Technical Webinar)
How to Automate Practically Anything with FME Server (Technical Webinar)How to Automate Practically Anything with FME Server (Technical Webinar)
How to Automate Practically Anything with FME Server (Technical Webinar)
 
Building a MVC eCommerce Site in Under 5 Minutes
Building a MVC eCommerce Site in Under 5 MinutesBuilding a MVC eCommerce Site in Under 5 Minutes
Building a MVC eCommerce Site in Under 5 Minutes
 
Capybara-Webkit
Capybara-WebkitCapybara-Webkit
Capybara-Webkit
 
Architecting single-page front-end apps
Architecting single-page front-end appsArchitecting single-page front-end apps
Architecting single-page front-end apps
 
Writing better tests for your java script app
Writing better tests for your java script appWriting better tests for your java script app
Writing better tests for your java script app
 
WebFest 2011 WebMatrix Overview by Gavin Warrener
WebFest 2011 WebMatrix Overview by Gavin WarrenerWebFest 2011 WebMatrix Overview by Gavin Warrener
WebFest 2011 WebMatrix Overview by Gavin Warrener
 
Single Page Applications
Single Page ApplicationsSingle Page Applications
Single Page Applications
 
Lizards & Pumpkins Catalog Replacement at mm17de
Lizards & Pumpkins Catalog Replacement at mm17deLizards & Pumpkins Catalog Replacement at mm17de
Lizards & Pumpkins Catalog Replacement at mm17de
 
Introduction To Single Page Application
Introduction To Single Page ApplicationIntroduction To Single Page Application
Introduction To Single Page Application
 
SGCE 2012 Lightning Talk-Single Page Interface
SGCE 2012 Lightning Talk-Single Page InterfaceSGCE 2012 Lightning Talk-Single Page Interface
SGCE 2012 Lightning Talk-Single Page Interface
 
Angular – Say Goodbye to Javascript Soup
Angular – Say Goodbye to Javascript SoupAngular – Say Goodbye to Javascript Soup
Angular – Say Goodbye to Javascript Soup
 
Single Page Application presentation
Single Page Application presentationSingle Page Application presentation
Single Page Application presentation
 
Frontend 'vs' Backend Getting the Right Mix
Frontend 'vs' Backend   Getting the Right MixFrontend 'vs' Backend   Getting the Right Mix
Frontend 'vs' Backend Getting the Right Mix
 
One ASP.NET
One ASP.NETOne ASP.NET
One ASP.NET
 
WordPress Security : What We Learnt When We Were Hacked : WordCamp Mumbai 2017
WordPress Security : What We Learnt When We Were Hacked : WordCamp Mumbai 2017WordPress Security : What We Learnt When We Were Hacked : WordCamp Mumbai 2017
WordPress Security : What We Learnt When We Were Hacked : WordCamp Mumbai 2017
 
Progressive Web Application - Advanced Topics
Progressive Web Application - Advanced TopicsProgressive Web Application - Advanced Topics
Progressive Web Application - Advanced Topics
 
The World of Dynamic Sites
The World of Dynamic SitesThe World of Dynamic Sites
The World of Dynamic Sites
 
Introduction To JavaScript
Introduction To JavaScriptIntroduction To JavaScript
Introduction To JavaScript
 

Viewers also liked

goodyear 8K Reports 11/13/08
goodyear 8K Reports 11/13/08goodyear 8K Reports 11/13/08
goodyear 8K Reports 11/13/08
finance12
 
constellation energy 2007 Third Quarter Form 10-Q
constellation energy 2007 Third Quarter Form 10-Qconstellation energy 2007 Third Quarter Form 10-Q
constellation energy 2007 Third Quarter Form 10-Q
finance12
 
Path 101 Opportunity
Path 101 OpportunityPath 101 Opportunity
Path 101 Opportunity
path101
 
international paper Q3 2001 10-Q
international paper Q3 2001 10-Qinternational paper Q3 2001 10-Q
international paper Q3 2001 10-Q
finance12
 
constellation energy 2006 Annual Report
constellation energy 2006 Annual Reportconstellation energy 2006 Annual Report
constellation energy 2006 Annual Report
finance12
 
Kerins Examples
Kerins ExamplesKerins Examples
Kerins Examples
ckerins
 
international paper Q2 2006 10-Q
international paper Q2 2006 10-Qinternational paper Q2 2006 10-Q
international paper Q2 2006 10-Q
finance12
 
constellation energy Policy and Procedures With Respect to Related Person Tra...
constellation energy Policy and Procedures With Respect to Related Person Tra...constellation energy Policy and Procedures With Respect to Related Person Tra...
constellation energy Policy and Procedures With Respect to Related Person Tra...
finance12
 
Raytheon Reports 2007 First Quarter Results
Raytheon Reports 2007 First Quarter ResultsRaytheon Reports 2007 First Quarter Results
Raytheon Reports 2007 First Quarter Results
finance12
 
raytheon Q4 Earnings Presentation
raytheon Q4 Earnings Presentationraytheon Q4 Earnings Presentation
raytheon Q4 Earnings Presentation
finance12
 
wyeth 2007 Financial Report
wyeth 	2007 Financial Reportwyeth 	2007 Financial Report
wyeth 2007 Financial Report
finance12
 

Viewers also liked (20)

ASP.NET MVC
ASP.NET MVCASP.NET MVC
ASP.NET MVC
 
Оптимизация высоконагруженных ASP.NET приложений, работающих с MS SQL Server ...
Оптимизация высоконагруженных ASP.NET приложений, работающих с MS SQL Server ...Оптимизация высоконагруженных ASP.NET приложений, работающих с MS SQL Server ...
Оптимизация высоконагруженных ASP.NET приложений, работающих с MS SQL Server ...
 
Refactoring
RefactoringRefactoring
Refactoring
 
Performance is a feature! - London .NET User Group
Performance is a feature! - London .NET User GroupPerformance is a feature! - London .NET User Group
Performance is a feature! - London .NET User Group
 
Strategic Communications Planning
Strategic Communications PlanningStrategic Communications Planning
Strategic Communications Planning
 
goodyear 8K Reports 11/13/08
goodyear 8K Reports 11/13/08goodyear 8K Reports 11/13/08
goodyear 8K Reports 11/13/08
 
constellation energy 2007 Third Quarter Form 10-Q
constellation energy 2007 Third Quarter Form 10-Qconstellation energy 2007 Third Quarter Form 10-Q
constellation energy 2007 Third Quarter Form 10-Q
 
Perspective
PerspectivePerspective
Perspective
 
Path 101 Opportunity
Path 101 OpportunityPath 101 Opportunity
Path 101 Opportunity
 
Viktoriin Rannametsa ja Kabli loodusest
Viktoriin Rannametsa ja Kabli loodusestViktoriin Rannametsa ja Kabli loodusest
Viktoriin Rannametsa ja Kabli loodusest
 
international paper Q3 2001 10-Q
international paper Q3 2001 10-Qinternational paper Q3 2001 10-Q
international paper Q3 2001 10-Q
 
constellation energy 2006 Annual Report
constellation energy 2006 Annual Reportconstellation energy 2006 Annual Report
constellation energy 2006 Annual Report
 
SOCIAL PR - Evento ABA Mídia
SOCIAL PR - Evento ABA MídiaSOCIAL PR - Evento ABA Mídia
SOCIAL PR - Evento ABA Mídia
 
Kerins Examples
Kerins ExamplesKerins Examples
Kerins Examples
 
international paper Q2 2006 10-Q
international paper Q2 2006 10-Qinternational paper Q2 2006 10-Q
international paper Q2 2006 10-Q
 
constellation energy Policy and Procedures With Respect to Related Person Tra...
constellation energy Policy and Procedures With Respect to Related Person Tra...constellation energy Policy and Procedures With Respect to Related Person Tra...
constellation energy Policy and Procedures With Respect to Related Person Tra...
 
3big trends
3big trends3big trends
3big trends
 
Raytheon Reports 2007 First Quarter Results
Raytheon Reports 2007 First Quarter ResultsRaytheon Reports 2007 First Quarter Results
Raytheon Reports 2007 First Quarter Results
 
raytheon Q4 Earnings Presentation
raytheon Q4 Earnings Presentationraytheon Q4 Earnings Presentation
raytheon Q4 Earnings Presentation
 
wyeth 2007 Financial Report
wyeth 	2007 Financial Reportwyeth 	2007 Financial Report
wyeth 2007 Financial Report
 

Similar to ASP.NET Quick Wins - 20 Tips and Tricks To Shift Your Application into High Gear

Similar to ASP.NET Quick Wins - 20 Tips and Tricks To Shift Your Application into High Gear (20)

Ruby on Rails Performance Tuning. Make it faster, make it better (WindyCityRa...
Ruby on Rails Performance Tuning. Make it faster, make it better (WindyCityRa...Ruby on Rails Performance Tuning. Make it faster, make it better (WindyCityRa...
Ruby on Rails Performance Tuning. Make it faster, make it better (WindyCityRa...
 
Windy cityrails performance_tuning
Windy cityrails performance_tuningWindy cityrails performance_tuning
Windy cityrails performance_tuning
 
10 Things You Can Do to Speed Up Your Web App Today
10 Things You Can Do to Speed Up Your Web App Today10 Things You Can Do to Speed Up Your Web App Today
10 Things You Can Do to Speed Up Your Web App Today
 
Mobile User Experience: Auto Drive through Performance Metrics
Mobile User Experience:Auto Drive through Performance MetricsMobile User Experience:Auto Drive through Performance Metrics
Mobile User Experience: Auto Drive through Performance Metrics
 
Web Front End Performance
Web Front End PerformanceWeb Front End Performance
Web Front End Performance
 
Silverlight vs HTML5 - Lessons learned from the real world...
Silverlight vs HTML5 - Lessons learned from the real world...Silverlight vs HTML5 - Lessons learned from the real world...
Silverlight vs HTML5 - Lessons learned from the real world...
 
Cvcc performance tuning
Cvcc performance tuningCvcc performance tuning
Cvcc performance tuning
 
Bringing the JAMstack to the Enterprise
Bringing the JAMstack to the EnterpriseBringing the JAMstack to the Enterprise
Bringing the JAMstack to the Enterprise
 
[QCon 2011] Por uma web mais rápida: técnicas de otimização de Sites
[QCon 2011] Por uma web mais rápida: técnicas de otimização de Sites[QCon 2011] Por uma web mais rápida: técnicas de otimização de Sites
[QCon 2011] Por uma web mais rápida: técnicas de otimização de Sites
 
Shopzilla - Performance By Design
Shopzilla - Performance By DesignShopzilla - Performance By Design
Shopzilla - Performance By Design
 
10 things you can do to speed up your web app today stir trek edition
10 things you can do to speed up your web app today   stir trek edition10 things you can do to speed up your web app today   stir trek edition
10 things you can do to speed up your web app today stir trek edition
 
Replay without Recording of Production Bugs for Service Oriented Applications
Replay without Recording of Production Bugs for Service Oriented ApplicationsReplay without Recording of Production Bugs for Service Oriented Applications
Replay without Recording of Production Bugs for Service Oriented Applications
 
Windows Server AppFabric Caching - What it is & when you should use it?
Windows Server AppFabric Caching - What it is & when you should use it?Windows Server AppFabric Caching - What it is & when you should use it?
Windows Server AppFabric Caching - What it is & when you should use it?
 
Performance Metrics for your Build Pipeline - presented at Vienna WebPerf Oct...
Performance Metrics for your Build Pipeline - presented at Vienna WebPerf Oct...Performance Metrics for your Build Pipeline - presented at Vienna WebPerf Oct...
Performance Metrics for your Build Pipeline - presented at Vienna WebPerf Oct...
 
Extreme Web Performance for Mobile Devices - Velocity Barcelona 2014
Extreme Web Performance for Mobile Devices - Velocity Barcelona 2014Extreme Web Performance for Mobile Devices - Velocity Barcelona 2014
Extreme Web Performance for Mobile Devices - Velocity Barcelona 2014
 
Optimizing React at Postmates
Optimizing React at PostmatesOptimizing React at Postmates
Optimizing React at Postmates
 
Isomorphic React Applications: Performance And Scalability
Isomorphic React Applications: Performance And ScalabilityIsomorphic React Applications: Performance And Scalability
Isomorphic React Applications: Performance And Scalability
 
Building a better web
Building a better webBuilding a better web
Building a better web
 
5 single page application principles developers need to know
5 single page application principles developers need to know5 single page application principles developers need to know
5 single page application principles developers need to know
 
20 tips for website performance
20 tips for website performance20 tips for website performance
20 tips for website performance
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 

Recently uploaded (20)

"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Modernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using BallerinaModernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using Ballerina
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
 
Decarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational PerformanceDecarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational Performance
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and Insight
 
Quantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation ComputingQuantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation Computing
 
JavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuideJavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate Guide
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 

ASP.NET Quick Wins - 20 Tips and Tricks To Shift Your Application into High Gear