10+1 Quick Tips to Boost Your ASP.Net Application Performance
Unless you have a great product, service or idea for which people are willing to wait, chances are highly likely that these potential clients will leave your website should your response time take too long to their incoming requests. Ignore your application’s performance and you are more likely to be dumped by your users sooner than expected.
To improve the performance of an ASP.Net application you need to optimize your front-end UI (user interface) code as well as the back-end database. You can also think of the following tips as a brief best practices guide for the ASP.net performance optimization. So, whether you are a developer, UI designer or member of the deployment team, the following tips may help you. No matter what’s your role in the project or what you do to boost performance of your application, always remember that your goal should be to:
· Minimize the amount of data you sent across the network.
· Reduce the number of server requests.
Here you go (in no particular order)
At Database level
#10. Use Stored Procedures. A Stored Procedure has an execution plan hence it always performs faster than T-SQL. Logic separation, Low network bandwidth consumption, improved data security and integrity are some of the added benefits of using a stored procedure.
#9. Write efficient queries. A few tips:
· If needed, de-normalize your database design a bit. Too many joins can make your query expensive.
· Avoid the use of cursor.
· Return only the Rows and Columns needed.
· Fully qualify database objects.
At Application Level
#8. ViewState is a bandwidth guzzler. To make its handling simple, always remember that for almost all practical purposes you can disable it for most of the controls (exception being DropDownLists, Listboxes and TreeViews). For TextBoxes, ViewState needs to be enabled only if you are using Text_Changed event. In a page if you are absolutely sure that you don’t require it all then it’s better to disable it at Page level. Add the following to your Page directive <%@ Page EnableViewState="false" %>
#7. SSL (Secure Socket Layer i.e. URLs beginning with https) is in fashion but avoid it and use it only for pages that transmit sensitive information like password, credit card number or any other information you deem sensitive. If you are using SSL for a page make sure the page contains minimal graphics. A web page deployed under simple http performs much faster than an https page.
#6. If you care about Scalability avoid using session state. Performance is not an issue while you are using one web server but be prepared for the worst if you are scaling out to multiple servers. At the same time, if you are sure that your application will never require multiple servers (or you’ll always have a limited number of users) session state is your best bait and performs faster than any other state management options.
#5. Use image sprites. Yes, this tip is more relevant to the UI designer than the developer. Sprites reduce the number of server requests and hence your page loads faster. W3Schools define an image sprite as a collection of images put into a single image. So, you are downloading a single optimized image with a single request rather than downloading multiple images with multiple requests. With CSS, you can define the coordinates to show just the part of the image you need
.#4. Add script references at the bottom of the page. Script references mainly JavaScript are common in ASP.Net applications, and if they are referred at the top the asynchronous downloads halt when a script reference is reached, severely impacting the page performance.
#3. For applications with huge number of users spread around the globe, use CDN (Content Delivery Network) for hosting images and scripts. This reduces load on your server and your users experiences a quick response from your application.
#2. Include the values of height and width attribute in tag. Yes, this is another one for UI designers! With a well-defined explicit height and width attribute space can be allocated for the image before it is downloaded i.e. quick page load.
#1. Validate form entries on the client using JavaScript. This helps to avoid unnecessary round trips to the server making your application quick and responsive. It leads to a better user experience.
Bonus Tip
Although this one is the most important yet it is the most common committed crime by beginners. While deploying at production server make sure that in the web.config file debug attribute is set to false. Always remember:
Never run production ASP.NET applications with debug=”true” enabled. By default it is enabled true in your web.config file. At production server it must be deployed with
There are many other tips and best practices recommended by experts and Microsoft for ASP.Net development; however these are the basic and most important ones. Apply these tips and see the difference in your application’s performance.
other blog entries
Course Directory [training on all levels]
- .NET Classes
- Agile/Scrum Classes
- Ajax Classes
- Android and iPhone Programming Classes
- Blaze Advisor Classes
- C Programming Classes
- C# Programming Classes
- C++ Programming Classes
- Cisco Classes
- Cloud Classes
- CompTIA Classes
- Crystal Reports Classes
- Design Patterns Classes
- DevOps Classes
- Foundations of Web Design & Web Authoring Classes
- Git, Jira, Wicket, Gradle, Tableau Classes
- IBM Classes
- Java Programming Classes
- JBoss Administration Classes
- JUnit, TDD, CPTC, Web Penetration Classes
- Linux Unix Classes
- Machine Learning Classes
- Microsoft Classes
- Microsoft Development Classes
- Microsoft SQL Server Classes
- Microsoft Team Foundation Server Classes
- Microsoft Windows Server Classes
- Oracle, MySQL, Cassandra, Hadoop Database Classes
- Perl Programming Classes
- Python Programming Classes
- Ruby Programming Classes
- Security Classes
- SharePoint Classes
- SOA Classes
- Tcl, Awk, Bash, Shell Classes
- UML Classes
- VMWare Classes
- Web Development Classes
- Web Services Classes
- Weblogic Administration Classes
- XML Classes
- Introduction to Spring 5 (2022)
16 December, 2024 - 18 December, 2024 - Introduction to C++ for Absolute Beginners
16 December, 2024 - 17 December, 2024 - See our complete public course listing
did you know? HSG is one of the foremost training companies in the United States
Our courses focus on two areas: the most current and critical object-oriented and component based tools, technologies and languages; and the fundamentals of effective development methodology. Our programs are designed to deliver technology essentials while improving development staff productivity.
An experienced trainer and faculty member will identify the client's individual training requirements, then adapt and tailor the course appropriately. Our custom training solutions reduce time, risk and cost while keeping development teams motivated. The Hartmann Software Group's faculty consists of veteran software engineers, some of whom currently teach at several Colorado Universities. Our faculty's wealth of knowledge combined with their continued real world consulting experience enables us to produce more effective training programs to ensure our clients receive the highest quality and most relevant instruction available. Instruction is available at client locations or at various training facilities located in the metropolitan Denver area.
Upcoming Classes
- Introduction to Spring 5 (2022)
16 December, 2024 - 18 December, 2024 - Introduction to C++ for Absolute Beginners
16 December, 2024 - 17 December, 2024 - See our complete public course listing
consulting services we do what we know ... write software
The coaching program integrates our course instruction with hands on software development practices. By employing XP (Extreme Programming) techniques, we teach students as follows:
Configure and integrate the needed development tools
MOntitor each students progress and offer feedback, perspective and alternatives when needed.
Establish an Action plan to yield a set of deliverables in order to guarantee productive learning.
Establish an Commit to a deliverable time line.
Hold each student accountable to a standard that is comparable to that of an engineer/project manager with at least one year's experience in the field.
These coaching cycles typically last 2-4 weeks in duration.
Business Rule isolation and integration for large scale systems using Blaze Advisor
Develop Java, .NET, Perl, Python, TCL and C++ related technologies for Web, Telephony, Transactional i.e. financial and a variety of other considerations.
Windows and Unix/Linux System Administration.
Application Server Administration, in particular, Weblogic, Oracle and JBoss.
Desperate application communication by way of Web Services (SOAP & Restful), RMI, EJBs, Sockets, HTTP, FTP and a number of other protocols.
Graphics Rich application development work i.e. fat clients and/or Web Clients to include graphic design
Performance improvement through code rewrites, code interpreter enhancements, inline and native code compilations and system alterations.
Mentoring of IT and Business Teams for quick and guaranteed expertise transfer.
Architect both small and large software development systems to include: Data Dictionaries, UML Diagrams, Software & Systems Selections and more