Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old January 6th, 2007, 03:54 AM
Registered User
 
Join Date: Jan 2007
Location: pune, , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Will static dataset affect the performance?

hi all,
        I used static dataset in my application bcoz i will make changes to it in around 3 methods will this effect my application's performance, if yes plz tell me any other way plz i need ur help
Thanks,
hari@eilisys.com

  #2 (permalink)  
Old January 9th, 2007, 12:05 PM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Static variables in ASPX pages == VERY BAD.

The classes that live in your web application are loaded into the context of the ASP.NET worker process (wp). Each time the wp receives a request for a page, it creates an instance of that page class. The class definition is loaded into the wp. As long as the wp is "alive" on the server (which it will be for quite some time) that class definition is present. Your static variables live within the class definition of each class, therefore the dataset you are using is not only taking of useful memory even while the server is idle, but more destructively it's visible to ALL USERS who see that same page. The dataset is shared.

This might be acceptable practice depending on what the data is. However, you state that you are making changes to it. This says to me that it's not something you want to have shared between users.

If it is data that is ok to share between users, I'd recommend using the web cache instead of a static page variable. When you need it, retrieve it from the cache.

-Peter


Similar Threads
Thread Thread Starter Forum Replies Last Post
Static DataSet pvasudevan ASP.NET 1.0 and 1.1 Professional 7 February 28th, 2008 10:36 PM
non-static reports to static html files miamikk ASP.NET 2.0 Basics 0 June 4th, 2007 01:48 PM
Dataset related performance ..... vije VB.NET 2002/2003 Basics 1 February 23rd, 2005 06:28 AM
Re: SQL Server dataset to ACCESS dataset dazzer ADO.NET 0 March 22nd, 2004 05:28 AM
static dataset ffranko99 VB.NET 2002/2003 Basics 0 August 1st, 2003 06:50 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.