SlideShare une entreprise Scribd logo
1  sur  8
Dot Net Training
How To Optimize Asp.Net Application ?
Dot Net Training
In this article, we will walk via some performance improvement techniques in ASP.NET
Web Applications.
It’s universal that customer expects the good performance of a web application.
Basically, large-scale Web applications are deployed to load-balancing servers to
share traffic evenly across a number of application servers.
Additional application servers are added without making any further changes to the
application.
The application server might enhance Web application performance; however, there
are ways to improve performance on the developer side as well.
You can follow certain optimization techniques when you code that can reduce a lot of
performance issues. It is essential to know which parts code or code parts can be
optimized, and how you can measure improvements in performance.
Dot Net Training
Here we share a number of optimization techniques that you can use:
Discard objects from the caller method than in the called method.
Use connection pooling such that the connections can be re-used during requirement
of future requests to the database.

Delete white spaces and extra tags to reduce the size of your pages. Make limited
use of graphics and consider using compressed graphics.

Reduce page load times by minimizing the scripts.

Use cascading style sheets to avoid repeated sending of the same formatting
directives to the client.

Use short control names because they generate unique HTMLID names.

Minimize redundant processing by using Page.IsPostBack .

Use for each loop instead of a for loop if possible.

Avoid using ViewState to facilitate faster page loads.
Dot Net Training
Cache the Web pages or a portion if the page is large. Use data caching for improving
the application performance instead of fetching data from a file or database.
Data is stored in the memory of Datasets hence write efficient SQL queries or
procedures that fetch only the required information.
So not use Page.DataBind. Instead, code data bind on specific controls because the
page-level method calls the DataBind method of every control on the page that
supports data binding.
Use minimal, call to DataBinder.Eval because this method uses reflection to access
the arguments that are passed in and to return the results. For example, if a page has
a table of 50 rows and 10 columns, DataBinder.Eval will be named 500 times if you
use DataBinder.Eval on each column. Instead, use clear casting offers better
performance by keeping away the cost of reflection. Cast the Container.DataItem as a
DataRowView, as shown in the following code .
Dot Net Training
<ItemTemplate> <tr> <td><%# ((DataRowView)Container.DataItem) ["First_Name"]
%></td> <td><%# ((DataRowView)Container.DataItem) ["Last_Name"] %></td>
</tr></ItemTemplate>
You can achieve better performance with clear casting if you use a DataReader to
bind your control and use the special methods to retrieve your data. Cast the
Container.DataItem as a DbDataRecord.
<ItemTemplate> <tr> <td><%# ((DbDataRecord)Container.DataItem) .GetString(0)
%></td> <td><%# ((DbDataRecord)Container.DataItem) .GetInt(1) %></td>
</tr></ItemTemplate>
Dot Net Training
Disable useless session states because ASP.NET Manages a session state by default
and lessens the cost in memory when you don’t use it.
For example, if your pages are fixed or when you don’t require to store information
captured in the page.
<@%Page EnableSessionState=”false”%>
make read only session state for retrieving data
<@%Page EnableSessionState =”ReadOnly”%>
Turn off tracing unless needed.
<trace enabled=”false” requestLimit=”8″ pageoutput=”false” traceMode=”SortByTime”
localOnly=”true”>
Use SqlDataReader to visit the read-only data and not DataSet.
You can return multiple result sets by using dynamic SQL, it is preferable to utilize
stored procedures to get multiple result sets
Dot Net Training
Using gzip compression can reduce the number of bytes sent by the server. This helps
faster page loads and also cuts down on bandwidth usage.
If you got a bunch of .NET Web services running in one IIS Application and utilized by
another IIS application, the first call to Web services, in most cases, might be pretty
slow. To speed up the initial call, you can create the XmlSerializers DLL at compile
time.
Hope the above-mentioned points would help you to code at ease.
If you want to learn ASP.Net and perfect yourself in .NET training, then CRB Tech
Solutions would be of great help and support for you. Join us with our updated
program in ASP.Net course.
Stay tuned to CRB Tech reviews for more technical optimization and other resources.
Thank You..!
Dot Net Training

Contenu connexe

Similaire à How to optimize asp dot net application ?

Ssis optimization –better designs
Ssis optimization –better designsSsis optimization –better designs
Ssis optimization –better designs
varunragul
 
Asp.net performance
Asp.net performanceAsp.net performance
Asp.net performance
Abhishek Sur
 
Application Performance Lecture
Application Performance LectureApplication Performance Lecture
Application Performance Lecture
Vishwanath Ramdas
 

Similaire à How to optimize asp dot net application ? (20)

IEEE KUET SPAC presentation
IEEE KUET SPAC  presentationIEEE KUET SPAC  presentation
IEEE KUET SPAC presentation
 
Tips and Tricks For Faster Asp.NET and MVC Applications
Tips and Tricks For Faster Asp.NET and MVC ApplicationsTips and Tricks For Faster Asp.NET and MVC Applications
Tips and Tricks For Faster Asp.NET and MVC Applications
 
Optimize access
Optimize accessOptimize access
Optimize access
 
Performace optimization (increase website speed)
Performace optimization (increase website speed)Performace optimization (increase website speed)
Performace optimization (increase website speed)
 
ASP.NET MVC Zero to Hero
ASP.NET MVC Zero to HeroASP.NET MVC Zero to Hero
ASP.NET MVC Zero to Hero
 
Website Performance at Client Level
Website Performance at Client LevelWebsite Performance at Client Level
Website Performance at Client Level
 
How to optimize your Magento store
How to optimize your Magento store How to optimize your Magento store
How to optimize your Magento store
 
Frontend performance
Frontend performanceFrontend performance
Frontend performance
 
Dat336
Dat336Dat336
Dat336
 
Ssis optimization –better designs
Ssis optimization –better designsSsis optimization –better designs
Ssis optimization –better designs
 
Asp.net performance
Asp.net performanceAsp.net performance
Asp.net performance
 
ASP.NET Best Practices - Useful Tips from the Trenches
ASP.NET Best Practices - Useful Tips from the TrenchesASP.NET Best Practices - Useful Tips from the Trenches
ASP.NET Best Practices - Useful Tips from the Trenches
 
Asp.Net Tips
Asp.Net TipsAsp.Net Tips
Asp.Net Tips
 
Oracle UCM: Web Site Performance Tuning
Oracle UCM: Web Site Performance TuningOracle UCM: Web Site Performance Tuning
Oracle UCM: Web Site Performance Tuning
 
Application Performance Lecture
Application Performance LectureApplication Performance Lecture
Application Performance Lecture
 
Building high scale, highly available websites in SharePoint 2010
Building high scale, highly available websites in SharePoint 2010Building high scale, highly available websites in SharePoint 2010
Building high scale, highly available websites in SharePoint 2010
 
From Concept to Launch How to Create a Custom WordPress Website.pdf
From Concept to Launch How to Create a Custom WordPress Website.pdfFrom Concept to Launch How to Create a Custom WordPress Website.pdf
From Concept to Launch How to Create a Custom WordPress Website.pdf
 
Introduction to Magento Optimization
Introduction to Magento OptimizationIntroduction to Magento Optimization
Introduction to Magento Optimization
 
Introduction To Mvc
Introduction To MvcIntroduction To Mvc
Introduction To Mvc
 
Extreme SSAS - Part II
Extreme SSAS - Part IIExtreme SSAS - Part II
Extreme SSAS - Part II
 

Plus de sonia merchant

Plus de sonia merchant (20)

What does dot net hold for 2016?
What does dot net hold for 2016?What does dot net hold for 2016?
What does dot net hold for 2016?
 
What does .net hold for 2016?
What does .net hold for 2016?What does .net hold for 2016?
What does .net hold for 2016?
 
Data protection api's in asp dot net
Data protection api's in asp dot netData protection api's in asp dot net
Data protection api's in asp dot net
 
Authorization p iv
Authorization p ivAuthorization p iv
Authorization p iv
 
Authorization iii
Authorization iiiAuthorization iii
Authorization iii
 
Authorization in asp dot net part 2
Authorization in asp dot net part 2Authorization in asp dot net part 2
Authorization in asp dot net part 2
 
Asp dot-net core problems and fixes
Asp dot-net core problems and fixes Asp dot-net core problems and fixes
Asp dot-net core problems and fixes
 
Search page-with-elasticsearch-and-dot-net
Search page-with-elasticsearch-and-dot-netSearch page-with-elasticsearch-and-dot-net
Search page-with-elasticsearch-and-dot-net
 
Build a-search-page-with-elastic search-and-dot-net
Build a-search-page-with-elastic search-and-dot-netBuild a-search-page-with-elastic search-and-dot-net
Build a-search-page-with-elastic search-and-dot-net
 
10 things to remember
10 things to remember10 things to remember
10 things to remember
 
Learn dot net attributes
Learn dot net attributesLearn dot net attributes
Learn dot net attributes
 
Learn about dot net attributes
Learn about dot net attributesLearn about dot net attributes
Learn about dot net attributes
 
Owin and-katana-overview
Owin and-katana-overviewOwin and-katana-overview
Owin and-katana-overview
 
Top 15-asp-dot-net-interview-questions-and-answers
Top 15-asp-dot-net-interview-questions-and-answersTop 15-asp-dot-net-interview-questions-and-answers
Top 15-asp-dot-net-interview-questions-and-answers
 
Next generation asp.net v next
Next generation asp.net v nextNext generation asp.net v next
Next generation asp.net v next
 
Dot net universal apps
Dot net universal appsDot net universal apps
Dot net universal apps
 
Browser frame building with c# and vb dot net
Browser frame building  with c# and vb dot netBrowser frame building  with c# and vb dot net
Browser frame building with c# and vb dot net
 
A simplest-way-to-reconstruct-.net-framework
A simplest-way-to-reconstruct-.net-frameworkA simplest-way-to-reconstruct-.net-framework
A simplest-way-to-reconstruct-.net-framework
 
Silverlight versions-features
Silverlight versions-featuresSilverlight versions-features
Silverlight versions-features
 
History of silverlight versions and its features
History of silverlight versions and its featuresHistory of silverlight versions and its features
History of silverlight versions and its features
 

Dernier

Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
MateoGardella
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
heathfieldcps1
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
Chris Hunter
 

Dernier (20)

Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 

How to optimize asp dot net application ?

  • 2. Dot Net Training In this article, we will walk via some performance improvement techniques in ASP.NET Web Applications. It’s universal that customer expects the good performance of a web application. Basically, large-scale Web applications are deployed to load-balancing servers to share traffic evenly across a number of application servers. Additional application servers are added without making any further changes to the application. The application server might enhance Web application performance; however, there are ways to improve performance on the developer side as well. You can follow certain optimization techniques when you code that can reduce a lot of performance issues. It is essential to know which parts code or code parts can be optimized, and how you can measure improvements in performance.
  • 3. Dot Net Training Here we share a number of optimization techniques that you can use: Discard objects from the caller method than in the called method. Use connection pooling such that the connections can be re-used during requirement of future requests to the database.  Delete white spaces and extra tags to reduce the size of your pages. Make limited use of graphics and consider using compressed graphics.  Reduce page load times by minimizing the scripts.  Use cascading style sheets to avoid repeated sending of the same formatting directives to the client.  Use short control names because they generate unique HTMLID names.  Minimize redundant processing by using Page.IsPostBack .  Use for each loop instead of a for loop if possible.  Avoid using ViewState to facilitate faster page loads.
  • 4. Dot Net Training Cache the Web pages or a portion if the page is large. Use data caching for improving the application performance instead of fetching data from a file or database. Data is stored in the memory of Datasets hence write efficient SQL queries or procedures that fetch only the required information. So not use Page.DataBind. Instead, code data bind on specific controls because the page-level method calls the DataBind method of every control on the page that supports data binding. Use minimal, call to DataBinder.Eval because this method uses reflection to access the arguments that are passed in and to return the results. For example, if a page has a table of 50 rows and 10 columns, DataBinder.Eval will be named 500 times if you use DataBinder.Eval on each column. Instead, use clear casting offers better performance by keeping away the cost of reflection. Cast the Container.DataItem as a DataRowView, as shown in the following code .
  • 5. Dot Net Training <ItemTemplate> <tr> <td><%# ((DataRowView)Container.DataItem) ["First_Name"] %></td> <td><%# ((DataRowView)Container.DataItem) ["Last_Name"] %></td> </tr></ItemTemplate> You can achieve better performance with clear casting if you use a DataReader to bind your control and use the special methods to retrieve your data. Cast the Container.DataItem as a DbDataRecord. <ItemTemplate> <tr> <td><%# ((DbDataRecord)Container.DataItem) .GetString(0) %></td> <td><%# ((DbDataRecord)Container.DataItem) .GetInt(1) %></td> </tr></ItemTemplate>
  • 6. Dot Net Training Disable useless session states because ASP.NET Manages a session state by default and lessens the cost in memory when you don’t use it. For example, if your pages are fixed or when you don’t require to store information captured in the page. <@%Page EnableSessionState=”false”%> make read only session state for retrieving data <@%Page EnableSessionState =”ReadOnly”%> Turn off tracing unless needed. <trace enabled=”false” requestLimit=”8″ pageoutput=”false” traceMode=”SortByTime” localOnly=”true”> Use SqlDataReader to visit the read-only data and not DataSet. You can return multiple result sets by using dynamic SQL, it is preferable to utilize stored procedures to get multiple result sets
  • 7. Dot Net Training Using gzip compression can reduce the number of bytes sent by the server. This helps faster page loads and also cuts down on bandwidth usage. If you got a bunch of .NET Web services running in one IIS Application and utilized by another IIS application, the first call to Web services, in most cases, might be pretty slow. To speed up the initial call, you can create the XmlSerializers DLL at compile time. Hope the above-mentioned points would help you to code at ease. If you want to learn ASP.Net and perfect yourself in .NET training, then CRB Tech Solutions would be of great help and support for you. Join us with our updated program in ASP.Net course. Stay tuned to CRB Tech reviews for more technical optimization and other resources.