ASP.NET OPTIMIZATION. Why Optimize? $$$ Whether you build applications for customers or not, enhanced applications save money.

Slides:



Advertisements
Similar presentations
ASP.NET Best Practices Dawit Wubshet Park University.
Advertisements

Chapter 10 Database Applications Copyright © 2011 by The McGraw-Hill Companies, Inc. All Rights Reserved. McGraw-Hill.
Chapter 9 Customizing Data with Web Controls. ASP.NET 2.0, Third Edition2.
ASP.NET (Active Server Page) SNU OOPSLA Lab. October 2005.
Chapter 12: ADO.NET and ASP.NET Programming with Microsoft Visual Basic.NET, Second Edition.
Kashif Jalal CA-240 (072) Web Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 2 of…
Web Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 3-1 of…
Performed by:Gidi Getter Svetlana Klinovsky Supervised by:Viktor Kulikov 08/03/2009.
Chapter 7 Managing Data Sources. ASP.NET 2.0, Third Edition2.
 Visual Studio has great support for building ASP.NET web applications  Real web application development involves more than just copying the files created.
A tour of new features introducing LINQ. Agenda of LINQ Presentation We have features for every step of the way LINQ Fundamentals Anonymous Functions/Lambda.
Stored Procedures Dr. Ralph D. Westfall May, 2009.
Christopher M. Pascucci Basic Structural Concepts of.NET Browser – Server Interaction.
DAT304 Leveraging XML and HTTP with Sql Server Irwin Dolobowsky Program Manager Webdata Group.
ASP.NET Programming with C# and SQL Server First Edition
Real-time HMI and SCADA software for .NET applications.
Tutorial: Introduction to ASP.NET Internet Technologies and Web Application 4 th February 2010.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
Chapter 8 Binding Data to Web Controls. ASP.NET 2.0, Third Edition2.
Chapter 9 Using the SqlDataSource Control. References aspx.
Database-Driven Web Sites, Second Edition1 Chapter 8 Processing ASP.NET Web Forms and Working With Server Controls.
1 Presented by Bikash Shrestha. 2 What is ASP.NET or ASP+? ASP.NET/ASP+ is a programming framework built on the common language runtime that can be used.
An Introduction to ASP.NET Ed Dunhill blogs.msdn.com/edunhill SLIDE7.
Chapter 10 Managing Data with ASP.NET. ASP.NET 2.0, Third Edition2.
Overview of Previous Lesson(s) Over View  ASP.NET Pages  Modular in nature and divided into the core sections  Page directives  Code Section  Page.
ASP.Net Web Applications. Characteristics of a typical data driven web application Web Server HTML Graphics Active-X Java Applets HTTP Request ADO / JDBC.
Chapter 71 Building Data-Driven ASP.NET Applications Introduction to ASP.NET By Kathleen Kalata.
Web Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 4-1 of…
ADO.NET A2 Teacher Up skilling LECTURE 3. What’s to come today? ADO.NET What is ADO.NET? ADO.NET Objects SqlConnection SqlCommand SqlDataReader DataSet.
Session 10: Managing State. Overview State Management Types of State Management Server-Side State Management Client-Side State Management The Global.asax.
State Management. What is State management Why State management ViewState QueryString Cookies.
Web Server Controls MacDonald Ch. 5 MIS 324 MIS 324 Professor Sandvig Professor Sandvig.
© Minder Chen, ASP.NET 2.0: Introduction - 1 ASP.NET 2.0 Minder Chen, Ph.D. Framework Base Class Library ADO.NET: Data & XML.
Tutorial 121 Creating a New Web Forms Page You will find that creating Web Forms is similar to creating traditional Windows applications in Visual Basic.
9 Chapter Nine Compiled Web Server Programs. 9 Chapter Objectives Learn about Common Gateway Interface (CGI) Create CGI programs that generate dynamic.
CIS 375—Web App Dev II ASP.NET 10 Database 2. 2 Introduction to Server-Side Data Server-side data access is unique in that Web pages are basically ___________.
Needs for Accessing Database To make your web site more dynamic and maintainable, you can display information on your web pages that are retrieved from.
Databases and Data Access  Introduction to ADO.NET  ADO.NET objects  ADP.NET namespaces  Differences between ADO and ADO.NET.
CSCI 6962: Server-side Design and Programming Introduction to Active Server Pages.
1 Data Bound Controls II Chapter Objectives You will be able to Use a Data Source control to get data from a SQL database and make it available.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Tutorial 30 – Bookstore Application: Client Tier Examining.
ASP.NET.. ASP.NET Environment ASP.NET is Microsoft's programming framework that enables the development of Web applications and services. It is an easy.
Murach’s ASP.NET 4.0/VB, C1© 2006, Mike Murach & Associates, Inc.Slide 1.
Delivering Excellence in Software Engineering ® EPAM Systems. All rights reserved. Data Binding in ASP.NET.
Copyright ©2004 Virtusa Corporation | CONFIDENTIAL ADO.Net Basics Ruwan Wijesinghe Trainer.
Christopher M. Pascucci Basic Structural Concepts of.NET Managing State & Scope.
ASP.NET State Management. Slide 2 Lecture Overview Client state management options Cookies Server state management options Application state Session state.
Session 8: ADO.NET. Overview Overview of ADO.NET What is ADO.NET? Using Namespaces The ADO.NET Object Model What is a DataSet? Accessing Data with ADO.NET.
STATE MANAGEMENT.  Web Applications are based on stateless HTTP protocol which does not retain any information about user requests  The concept of state.
7 Chapter Seven Client-side Scripts. 7 Chapter Objectives Create HTML forms Learn about client-side scripting languages Create a client-side script using.
Chapter Thirteen Working with Access Databases and LINQ Programming with Microsoft Visual Basic th Edition.
PAGE DIRECTIVES. Page Directives  They are instructions, inserted at the top of an ASP.NET page, to control the behavior of ASP.NET pages.  So it is.
ASP.NET in Definition: 1.ASP.NET is a web application framework developed and marketed by Microsoft to allow programmers to build dynamic web sites,
The Problem of State. We will look at… Sometimes web development is just plain weird! Internet / World Wide Web Aspects of their operation The role of.
ASP.NET (Active Server Page) SNU OOPSLA Lab. October 2005.
Security Attacks CS 795. Buffer Overflow Problem Buffer overflow Analysis of Buffer Overflow Attacks.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
5-1 VISUAL J++ Colorado Technical University IT420 Tim Peterson.
ASP-2-1 SERVER AND CLIENT SIDE SCRITPING Colorado Technical University IT420 Tim Peterson.
Overview of Previous Lesson(s) Over View  ASP is a technology that enables scripts in web pages to be executed by an Internet server.  ASP.NET is a.
Introduction to ASP.NET development. Background ASP released in 1996 ASP supported for a minimum 10 years from Windows 8 release ASP.Net 1.0 released.
ASP.net Course From Intermediate to Advance level By Arsalan Ahmed 3 Months Course Cell :
Introduction to ASP.NET, Second Edition2 Chapter Objectives.
111 State Management Beginning ASP.NET in C# and VB Chapter 4 Pages
State Management.
Active Server Pages ASP.Net
Chapter 23 – ASP.NET Outline 23.1 Introduction NET Overview
ASP.NET Module Subtitle.
ASP.NET 4.0 State Management Improvements – Deep Dive
Web Development Using ASP .NET
Presentation transcript:

ASP.NET OPTIMIZATION

Why Optimize? $$$ Whether you build applications for customers or not, enhanced applications save money.

Optimize Your Web Applications Improve your code Research strategies, methods, techniques Revisit old code Monitor your app Out-of-Box Third party Create your own

String Manipulation Use String Builders for modifying strings Mutable Value- can be modified appending removing replacing inserting characters More than three changes Ex.aspx

Server.Transfer HttpServerUtility.Transfer Parameters Path –URL as string preserveForm True- preserves QueryString and Form collections False(default)- clears QueryString and Form collections Terminates execution of the current page Begins execution of a new page Use when redirecting to another page within same application Avoids needless client-side redirection

Option Strict & Option Explicit For Visual Basic, VBScript and JScript Late binding expensive performance-wise Option Explicit forces you to declare your variables/objects before using them set to “On” by default Option Strict requires you to explicitly declare datatype conversions by disallowing late binding

Option Strict & Option Explicit Project Properties- turn them “On” In Page or Control Directive ‘ ’ Strict="true" Result- faster execution StrictEx.aspx

Avoid Exceptions Exceptions cause performance to suffer Avoid relying on exceptions in your code Anticipate exceptions checking for null check for specific values before applying math operations

Debug Mode Disable debug mode before you deploy a release application or conduct performance measurements Web.config Attribute- debug Option true- Specifies compilation of debug binaries false- Specifies compilation of retail binaries

Debug Mode Visual Studio When building change ddl Debug Release Examples.dll size From 380kb to 364kb From 412kb to 392kb

Data Access Open fewest possible connections (connection pooling) Data Access Layer- between Business Services and Data Services Data Access Make use of automatic pooling automatic transaction handling

Data Access Data Access Method SQL Server-based data access method provided by the.NET Framework Recommended for high performance Stored Procedures Additional performance boost Instead of ad-hoc queries

Data Access Advantages to Stored Procedures Database operations Can be encapsulated in a single command Are optimized for best performance Provides additional security ADO.NET Command object Explicitly defines stored procedure parameters Access output parameters and return values

Data Access Execute Scalar- value of the first column of the first row of the result set Retrieves a single value Examples- values returned by an aggregate function Count ( * ) Sum ( Field ) Avg ( Field )

Data Access SqlDataReader- forward-only data stream higher performance than the DataSet class Tabular Data Stream ( TDS ) protocol IEnumerable interface Instead of While Reader.Read() Databind()

ViewState Enabled by default To disable set MaintainState property to false per control per page per usercontrol

ViewState Light Control Group Label TextBox Button LinkButton ImageButton CheckBox RadioButton HyperLink

ViewState Datagrid DataList Repeater CheckBoxList

Session State Disable when not using per-user session state Configure Session State ReadOnly web.config file

Session State Provider In-process session state Out-of-process session state as a Windows Service Out-of-process session state in a SQL Server database

Server Round Trips Avoid unnecessary round trips to the server retrieving data storing data Use HTML controls instead of ASP.NET server controls Use appropriate postback event handling Use client side script for data manipulation

Cache Avoids overhead of retrieving information from resources outside the application. Stores page output or application data Stores data on the client or on the server

Cache Output caching, which caches the dynamic response generated by a request. Fragment caching, which caches portions of a response generated by a request. Data caching, which allows developers to programmatically retain arbitrary data across requests

Cache Sub Page_Load Dim objItem As DictionaryEntry For each objItem in Cache lblContents.Text &= " " & objItem.Key lblContents.Text &= "=" & objItem.Value.ToString Next End Sub

String Manipulation us/cpref/html/frlrfsystemtextstringbuilderclasstopic.asp us/cpref/html/frlrfsystemstringclasstopic.asp

Server.Transfer us/cpref/html/frlrfsystemwebhttpserverutilityclasstransfertopic.asp us/cpref/html/frlrfSystemWebHttpServerUtilityClassTransferTopic.asp

Option Strict & Option Explicit webapps/developinghigh- performanceaspnetapplications.aspx /10/07/173.aspx

Avoid Exceptions webapps/developinghigh- performanceaspnetapplications.aspx

Debug en- us/vsdebug/html/vxtskdebugmodeinaspnetapplications.asp compilationsection.aspx 73.aspx 09/30/27318.aspx

Data Access ng-a-Robust-and-Highly-Scalable- Distributed-Architecture-using-VB-NET/1

ViewState viewstate