SlideShare a Scribd company logo
1 of 3
Download to read offline
sales@biztechcs.com
Improve your Asp.Net Performance with these 5
Methods
When we talk about performance, ASP.Net is the first platform that comes in our
mind. It is a stable foundation with power pack features for web applications.
However, to ensure the smooth working of an application, it is necessary to check
the application performance from time to time. Removing the unnecessary codes,
updating the latest version and advanced features are the few ways to improve
your ASP.Net Core application performance. Let’s find out more!
1. Avoid Blocking Calls
Design your ASP.Net Core application to execute multiple processes
simultaneously using an Asynchronous API handling numerous requests without
waiting on blocking calls. Instead of waiting for the synchronous tasks to
complete, it starts working on another thread.
The common mistake we make is calling Task.Wait or Task.Run that blocks
asynchronous execution and results in unnecessary thread pool scheduling. So
avoid calling Task.Run as ASP.Net Core already runs the thread in the normal
thread pool.
Instead, try using hot code paths, call data access, I/O, and long-running patterns
and API asynchronously. Make control/razer page actions asynchronous to
benefit from​ ​async/await​ patterns.
2. Use Cache
The common trick to increase the application performance is to reduce the
number of server requests sent out. This can be achieved if we store the received
response from the server. That means, the next time a call is made for a similar
response, instead of requesting the server, the caching feature would first check
the stored data and if it matches, retrieve it and send it to the user without calling
www.biztechcs.com
sales@biztechcs.com
the server; saving time and improving the overall performance. Usually, there are
three types of caching: client-side, server-side, or client/server-side. Talking about
ASP.Net Core Development​, it provides caching in-memory, response caching, and
distributed caching.
3. Optimize Data Access and I/O
Accessing data by interacting with data stores is the slowest part of an ASP.Net
Core application. Thus, it is crucial to read and write effectively for good
performance.
Recommendations:
● Call all the data asynchronously
● Do not retrieve more than the required data
● Consider caching frequently. Use MemoryCache or a
DistributedCache depending on the scenario
● Minimize the network round trips
● Try to retrieve the data in a single call rather than multiple calls
● Use no-tracking queries in Entity Framework Core while accessing
read-only data as it returns the results efficiently
● Filter and aggregate LINQ queries so that database performs
filtration
● Do not use projection queries on collections as they can result in
“N+1” SQL queries
Recommendation: Measure the impact of high performing queries before coding.
4. Handle Response-Request Process Asynchronously
We know that a controller and page model can handle most of the app requests
by calling the necessary services. So try to complete long-running tasks outside of
HTTP requests by handling the requests with background services. Use real-time
communication options such as​ ​SignalR​ for communication with clients
www.biztechcs.com
sales@biztechcs.com
asynchronously. Completing the work out of the process is beneficial for CPU
intensive tasks.
Recommendation: Avoid reading large requests into memory.
5. Use Response Caching Middleware
To fasten your code performance, use middleware components that request
processing pipelines, and optimize the frequently-called code paths by storing
responses and serving them later through the cache. The common examples
include - custom logging, authorization handlers, or initialization of transient
services.
Recommendation: Do not use custom middleware components with long-running
tasks.
Bonus​ ​Tips to Improve ASP.Net Core Development
● Avoid synchronous read or write on HttpRequest/HttpResponse
body
● Prefer ReadFormAsync over Request.Form
● Avoid reading large request bodies or response bodies into memory
● Do not store IHttpContextAccessor.HttpContext in a field
● Do not access HttpContext from multiple threads
With these tips, you can improve your ASP.Net application performance. Hire
ASP.Net Developer or contact your ​ASP.Net development company to implement
these features in your application today.
This Article Post is Originally Posted Here:
https://www.sooperarticles.com/internet-articles/web-development-articles/imp
rove-your-asp-net-performance-these-5-methods-1790992.html
www.biztechcs.com

More Related Content

More from Biztech Consulting & Solutions

More from Biztech Consulting & Solutions (16)

Microservices: Detailed Guide
Microservices: Detailed GuideMicroservices: Detailed Guide
Microservices: Detailed Guide
 
12 best programming languages for web & app development
12 best programming languages for web & app development12 best programming languages for web & app development
12 best programming languages for web & app development
 
Cross platform app development a complete guide
Cross platform app development a complete guideCross platform app development a complete guide
Cross platform app development a complete guide
 
Complete guide on mobile app maintenance
Complete guide on mobile app maintenanceComplete guide on mobile app maintenance
Complete guide on mobile app maintenance
 
Everything you need to know about flutter 2.2
Everything you need to know about flutter 2.2Everything you need to know about flutter 2.2
Everything you need to know about flutter 2.2
 
11 reasons why flutter is better for app development
11 reasons why flutter is better for app development11 reasons why flutter is better for app development
11 reasons why flutter is better for app development
 
Augmented reality in retail beginning of an immersive era
Augmented reality in retail beginning of an immersive eraAugmented reality in retail beginning of an immersive era
Augmented reality in retail beginning of an immersive era
 
Challenges of adopting ar in education
Challenges of adopting ar in educationChallenges of adopting ar in education
Challenges of adopting ar in education
 
Why you should choose a custom app over a clone app
Why you should choose a custom app over a clone app Why you should choose a custom app over a clone app
Why you should choose a custom app over a clone app
 
Magento e commerce development trends for 2020
Magento e commerce development trends for 2020Magento e commerce development trends for 2020
Magento e commerce development trends for 2020
 
9 reasons why angular js web development should be your choice in 2020
9 reasons why angular js web development should be your choice in 20209 reasons why angular js web development should be your choice in 2020
9 reasons why angular js web development should be your choice in 2020
 
SugarCRM Brochure - Biztech Consultancy
SugarCRM Brochure - Biztech ConsultancySugarCRM Brochure - Biztech Consultancy
SugarCRM Brochure - Biztech Consultancy
 
CakePHP Brochure - Biztech Consultancy
CakePHP Brochure - Biztech ConsultancyCakePHP Brochure - Biztech Consultancy
CakePHP Brochure - Biztech Consultancy
 
Top 5 IDE that Simplifies PHP Development
Top 5 IDE that Simplifies PHP DevelopmentTop 5 IDE that Simplifies PHP Development
Top 5 IDE that Simplifies PHP Development
 
Top 5 Tips to Integrate Your ERP with CRM System
Top 5 Tips to Integrate Your ERP with CRM SystemTop 5 Tips to Integrate Your ERP with CRM System
Top 5 Tips to Integrate Your ERP with CRM System
 
Tech Future – The Mobile Applications
Tech Future – The Mobile ApplicationsTech Future – The Mobile Applications
Tech Future – The Mobile Applications
 

Recently uploaded

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
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)

MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
"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 ...
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
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
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
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
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
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
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
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...
 
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
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 

Improve your asp.net performance with these 5 methods

  • 1. sales@biztechcs.com Improve your Asp.Net Performance with these 5 Methods When we talk about performance, ASP.Net is the first platform that comes in our mind. It is a stable foundation with power pack features for web applications. However, to ensure the smooth working of an application, it is necessary to check the application performance from time to time. Removing the unnecessary codes, updating the latest version and advanced features are the few ways to improve your ASP.Net Core application performance. Let’s find out more! 1. Avoid Blocking Calls Design your ASP.Net Core application to execute multiple processes simultaneously using an Asynchronous API handling numerous requests without waiting on blocking calls. Instead of waiting for the synchronous tasks to complete, it starts working on another thread. The common mistake we make is calling Task.Wait or Task.Run that blocks asynchronous execution and results in unnecessary thread pool scheduling. So avoid calling Task.Run as ASP.Net Core already runs the thread in the normal thread pool. Instead, try using hot code paths, call data access, I/O, and long-running patterns and API asynchronously. Make control/razer page actions asynchronous to benefit from​ ​async/await​ patterns. 2. Use Cache The common trick to increase the application performance is to reduce the number of server requests sent out. This can be achieved if we store the received response from the server. That means, the next time a call is made for a similar response, instead of requesting the server, the caching feature would first check the stored data and if it matches, retrieve it and send it to the user without calling www.biztechcs.com
  • 2. sales@biztechcs.com the server; saving time and improving the overall performance. Usually, there are three types of caching: client-side, server-side, or client/server-side. Talking about ASP.Net Core Development​, it provides caching in-memory, response caching, and distributed caching. 3. Optimize Data Access and I/O Accessing data by interacting with data stores is the slowest part of an ASP.Net Core application. Thus, it is crucial to read and write effectively for good performance. Recommendations: ● Call all the data asynchronously ● Do not retrieve more than the required data ● Consider caching frequently. Use MemoryCache or a DistributedCache depending on the scenario ● Minimize the network round trips ● Try to retrieve the data in a single call rather than multiple calls ● Use no-tracking queries in Entity Framework Core while accessing read-only data as it returns the results efficiently ● Filter and aggregate LINQ queries so that database performs filtration ● Do not use projection queries on collections as they can result in “N+1” SQL queries Recommendation: Measure the impact of high performing queries before coding. 4. Handle Response-Request Process Asynchronously We know that a controller and page model can handle most of the app requests by calling the necessary services. So try to complete long-running tasks outside of HTTP requests by handling the requests with background services. Use real-time communication options such as​ ​SignalR​ for communication with clients www.biztechcs.com
  • 3. sales@biztechcs.com asynchronously. Completing the work out of the process is beneficial for CPU intensive tasks. Recommendation: Avoid reading large requests into memory. 5. Use Response Caching Middleware To fasten your code performance, use middleware components that request processing pipelines, and optimize the frequently-called code paths by storing responses and serving them later through the cache. The common examples include - custom logging, authorization handlers, or initialization of transient services. Recommendation: Do not use custom middleware components with long-running tasks. Bonus​ ​Tips to Improve ASP.Net Core Development ● Avoid synchronous read or write on HttpRequest/HttpResponse body ● Prefer ReadFormAsync over Request.Form ● Avoid reading large request bodies or response bodies into memory ● Do not store IHttpContextAccessor.HttpContext in a field ● Do not access HttpContext from multiple threads With these tips, you can improve your ASP.Net application performance. Hire ASP.Net Developer or contact your ​ASP.Net development company to implement these features in your application today. This Article Post is Originally Posted Here: https://www.sooperarticles.com/internet-articles/web-development-articles/imp rove-your-asp-net-performance-these-5-methods-1790992.html www.biztechcs.com