SlideShare ist ein Scribd-Unternehmen logo
1 von 3
Downloaden Sie, um offline zu lesen
How To Optimize Asp.Net
Application ?
August 1, 2016.net training, Computer Training.net certification in pune, .net classes, .net
courses, .net courses in pune, .net training institute pune, ASP.net courses
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.
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.
• 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 .
<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>
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.
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.
Related Articles:
Importance of Asp.Net Development
Top 5 Reasons That Make ASP.NET More Secure Over PHP

Weitere ähnliche Inhalte

Andere mochten auch

Visita al jardín botánico
Visita al jardín botánicoVisita al jardín botánico
Visita al jardín botánico
sandraghi
 
Pre benjamin-d
Pre benjamin-dPre benjamin-d
Pre benjamin-d
fbcat
 
Transversalidad para Estadística Descriptiva
Transversalidad para Estadística DescriptivaTransversalidad para Estadística Descriptiva
Transversalidad para Estadística Descriptiva
Joan Fernando Chipia Lobo
 

Andere mochten auch (18)

Proyecto.
Proyecto.Proyecto.
Proyecto.
 
Visita al jardín botánico
Visita al jardín botánicoVisita al jardín botánico
Visita al jardín botánico
 
Sistema Operativo Androin
Sistema Operativo AndroinSistema Operativo Androin
Sistema Operativo Androin
 
Hoja litúrgica del domingo XXXI del Tiempo Ordinario- ciclo A
Hoja litúrgica del domingo XXXI del Tiempo Ordinario- ciclo AHoja litúrgica del domingo XXXI del Tiempo Ordinario- ciclo A
Hoja litúrgica del domingo XXXI del Tiempo Ordinario- ciclo A
 
2011 revista-cled
2011 revista-cled2011 revista-cled
2011 revista-cled
 
2
22
2
 
5 things you didn't know about twitter
5 things you didn't know about twitter5 things you didn't know about twitter
5 things you didn't know about twitter
 
Regresion
RegresionRegresion
Regresion
 
Pre benjamin-d
Pre benjamin-dPre benjamin-d
Pre benjamin-d
 
1.LPH
1.LPH1.LPH
1.LPH
 
Transversalidad para Estadística Descriptiva
Transversalidad para Estadística DescriptivaTransversalidad para Estadística Descriptiva
Transversalidad para Estadística Descriptiva
 
Análisis de salud de una comunidad
Análisis de salud de una comunidadAnálisis de salud de una comunidad
Análisis de salud de una comunidad
 
Clase inicial de Bioestadística U-2014
Clase inicial de Bioestadística U-2014Clase inicial de Bioestadística U-2014
Clase inicial de Bioestadística U-2014
 
Empoderamiento en el aula.
Empoderamiento en el aula.Empoderamiento en el aula.
Empoderamiento en el aula.
 
Construcción de webquest para la enseñanza de la matemática
Construcción de webquest para la enseñanza de la matemáticaConstrucción de webquest para la enseñanza de la matemática
Construcción de webquest para la enseñanza de la matemática
 
Variables y escalas de medicion
Variables y escalas de medicionVariables y escalas de medicion
Variables y escalas de medicion
 
Distribuciones de probabilidad
Distribuciones de probabilidadDistribuciones de probabilidad
Distribuciones de probabilidad
 
Técnicas e instrumentos
Técnicas e instrumentosTécnicas e instrumentos
Técnicas e instrumentos
 

Ähnlich wie How to optimize asp dot-net application

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
 

Ähnlich wie How to optimize asp dot-net application (20)

How To Optimize Asp.Net Application ?
How To Optimize Asp.Net Application ?How To Optimize Asp.Net Application ?
How To Optimize Asp.Net Application ?
 
Optimize access
Optimize accessOptimize access
Optimize access
 
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
 
Performace optimization (increase website speed)
Performace optimization (increase website speed)Performace optimization (increase website speed)
Performace optimization (increase website speed)
 
Frontend performance
Frontend performanceFrontend performance
Frontend 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
 
Magento e commerce performance optimization
Magento e commerce performance optimizationMagento e commerce performance optimization
Magento e commerce performance optimization
 
How to Improve Magento Performance | Tips to Speed up Magento eCommerce Site/...
How to Improve Magento Performance | Tips to Speed up Magento eCommerce Site/...How to Improve Magento Performance | Tips to Speed up Magento eCommerce Site/...
How to Improve Magento Performance | Tips to Speed up Magento eCommerce Site/...
 
Oracle UCM: Web Site Performance Tuning
Oracle UCM: Web Site Performance TuningOracle UCM: Web Site Performance Tuning
Oracle UCM: Web Site Performance Tuning
 
Asp.net performance
Asp.net performanceAsp.net performance
Asp.net performance
 
ASP.NET MVC Zero to Hero
ASP.NET MVC Zero to HeroASP.NET MVC Zero to Hero
ASP.NET MVC Zero to Hero
 
Dat336
Dat336Dat336
Dat336
 
How to optimize your Magento store
How to optimize your Magento store How to optimize your Magento store
How to optimize your Magento store
 
Weblogic performance tuning2
Weblogic performance tuning2Weblogic performance tuning2
Weblogic performance tuning2
 
Weblogic Cluster advanced performance tuning
Weblogic Cluster advanced performance tuningWeblogic Cluster advanced performance tuning
Weblogic Cluster advanced 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
 
Asp.Net Tips
Asp.Net TipsAsp.Net Tips
Asp.Net Tips
 
Magento Performance Optimization 101
Magento Performance Optimization 101Magento Performance Optimization 101
Magento Performance Optimization 101
 

Mehr von sonia merchant

Mehr von 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
 

Kürzlich hochgeladen

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
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
MateoGardella
 
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
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 

Kürzlich hochgeladen (20)

Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
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
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
 
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
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
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
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).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
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 

How to optimize asp dot-net application

  • 1. How To Optimize Asp.Net Application ? August 1, 2016.net training, Computer Training.net certification in pune, .net classes, .net courses, .net courses in pune, .net training institute pune, ASP.net courses 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. 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. • 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.
  • 2. 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 . <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> 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. 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. Related Articles:
  • 3. Importance of Asp.Net Development Top 5 Reasons That Make ASP.NET More Secure Over PHP