473,586 Members | 2,718 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ASP Dictionary Object

Hi,

While pouring over some code I've discovered a previous developer heavily
uses the "dictionary " object. Whilst I see some of the advantages of using
this system It's something I've not used myself so am not sure of the
limitations.

We are about to widen the scope of the website it's being used on to a
WorldWide system - greatly increasing the number of users that will be using
the website.

What I'd like to know is are there any performance issues with using this on
a heavily used site?

Thanks!

Rob
Jul 21 '05 #1
5 2082
TWiSTeD ViBE wrote:
While pouring over some code I've discovered a previous developer
heavily uses the "dictionary " object. Whilst I see some of the
advantages of using this system It's something I've not used myself
so am not sure of the limitations.

We are about to widen the scope of the website it's being used on to a
WorldWide system - greatly increasing the number of users that will
be using the website.

What I'd like to know is are there any performance issues with using
this on a heavily used site?


"Heavy use" is a bit undescriptive.

I see no reason why heavy use of scripting dictionaries should be a problem,
provided the usual pitfalls are avoided. Is the dictionary object assigned
to Application or Session variables? Did the developer release his objects
properly in each script? *Those* are scalability hurdles, not mere heavy
use.

--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
Jul 21 '05 #2
Hi - thanks for your help...

"Heavy use" is undescriptive as it's difficult to gage the increase in
traffic - the site gets around 300,000 page impressions a day - this can
expect to be at least doubled (possibly tripled +).

The object is assigned to neither session nor application variables however
it is used multiple times on each page and doesn't appear to be closed off
properly (however I didn't think this would make a difference with the
garbage collector?).

Does any of this affect your advice?

Thanks...

Rob

"Dave Anderson" <GT**********@s pammotel.com> wrote in message
news:Od******** ******@TK2MSFTN GP15.phx.gbl...
TWiSTeD ViBE wrote:
While pouring over some code I've discovered a previous developer
heavily uses the "dictionary " object. Whilst I see some of the
advantages of using this system It's something I've not used myself
so am not sure of the limitations.

We are about to widen the scope of the website it's being used on to a
WorldWide system - greatly increasing the number of users that will
be using the website.

What I'd like to know is are there any performance issues with using
this on a heavily used site?


"Heavy use" is a bit undescriptive.

I see no reason why heavy use of scripting dictionaries should be a
problem,
provided the usual pitfalls are avoided. Is the dictionary object assigned
to Application or Session variables? Did the developer release his objects
properly in each script? *Those* are scalability hurdles, not mere heavy
use.

--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message.
Use
of this email address implies consent to these terms. Please do not
contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.

Jul 21 '05 #3
TWiSTeD ViBE wrote:
The object is assigned to neither session nor application variables
however it is used multiple times on each page and doesn't appear to
be closed off properly (however I didn't think this would make a
difference with the garbage collector?).


In principle, they should be swept up by GC each time the page goes out of
scope, and I have no direct knowledge of such a problem with scripting
dictionary objects.

But it is considered bad practice *not* to void variables assigned with SET
in VBScript, and there are countless examples of objects that NEVER get
collected if this step is not followed.

ASP FAQ answers it best, in my opinion, by asking: "What do you gain by NOT
closing and destroying objects?"
http://aspfaq.com/show.asp?id=2435

--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
Jul 21 '05 #4
> But it is considered bad practice *not* to void variables assigned with
SET
in VBScript, and there are countless examples of objects that NEVER get
collected if this step is not followed.


As previously said this isn't my code - I am well aware that closing objects
is good practice and always close objects properly myself.

This doesn't answer my question - I'm simply trying to ascertain the
scalability of the dictionary object since it's not something I've used
myself before.

Thanks for you help.
Jul 21 '05 #5
TWiSTeD ViBE wrote:
I'm simply trying to ascertain the
scalability of the dictionary object since it's not something I've used
myself before.


Take a look at these newsgroups' archives:
http://www.google.com/groups?as_q=di...sp.*&lr=&hl=en

Session or Application variables satisfy the need for associative arrays
in most instances.

If data is grouped into categories (i.e., "dictionari es") then using a
prefix to designate a dictionary entry provides much of the Dictionary
object functionality:

Value = Session("$DIC$" & strVarName)
Session("$DIC$" & strVarName) = Value

instead of the corresponding Dictionary methods:

Value = Dic.Item( strVarName )
Dic.Add( strVarName, Value )

You can extend the above to allow multiple "dictionari es" , hide the
above functionality in functions or subroutines or make a VBScript class
with methods similar to the Dictionary object. All are probably
significantly faster than the Dictionary object.

Good Luck,
Michael D. Kersey
Jul 21 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3578
by: none | last post by:
or is it just me? I am having a problem with using a dictionary as an attribute of a class. This happens in python 1.5.2 and 2.2.2 which I am accessing through pythonwin builds 150 and 148 respectively In the sample code you see that I have class Item and class Dict class Dict contains a dictionary called items. The items dictionary...
8
5574
by: Rodd Snook | last post by:
I have an application which makes extensive use of the Scripting.Dictionary object. I'm not doing anything silly like putting them outside the page scope -- just creating quite a few of them and stuffing quite a lot of data (from and MS SQL database) into them. On Windows 2000 server, everything is fine. If the data structures get really...
26
4039
by: Alan Silver | last post by:
Hello, I have a server running Windows Server 2003, on which two of the web sites use the MegaBBS ASP forum software. Both sites suddenly developed the same error, which seems to be connected to the dictionary object. After some tinkering, I whittled it down to the following (complete) ASP... <%@ CodePage=65001 Language="VBScript"%>
2
3412
by: jg | last post by:
I was trying to get custom dictionary class that can store generic or string; So I started with the example given by the visual studio 2005 c# online help for simpledictionay object That seem to miss a few things including #endregion directive and the ending class } Is there not a simple way like in dotnet vb? I managed to get the...
1
9243
by: john wright | last post by:
I have a dictionary oject I created and I want to bind a listbox to it. I am including the code for the dictionary object. Here is the error I am getting: "System.Exception: Complex DataBinding accepts as a data source either an IList or an IListSource at System.Windows.Forms.ListControl.set_DataSource(Object value)
4
2316
by: Betina Andersen | last post by:
I have a dictionary object, then I create a new dictionary object and sets it equal to my original, then I pass the new dictionary object to a function that changes some of my values - but then my original dictionary also gets changed and that was not the intention, can someone explain to me why it behaves that way and how do I avoid it, så I...
4
14695
by: NullQwerty | last post by:
Hi folks, I have a Dictionary which contains a string key and an object value. I want the object value to point to a property in my class and I want it to be by reference, so that later on I can change the value of the property through the dictionary. I am having difficulty making the value be by reference. Is this possible? I've even...
3
4175
by: wildThought | last post by:
If I have an object that contains a generic dictionary inside of it, how do I get access to its properties such as count?
6
10166
by: GiJeet | last post by:
hello, I'm trying to use a dictionary as a class member. I want to use a property to get/set the key/value of the dictionary but I'm confused as how to use a dictionary as a property. Since there are 2 parts, I don't know how to setup the get/sets. I tried searching but could not find any examples. I'd appreciate an example of how to get/...
2
3125
by: Andy B | last post by:
I don't know if this is even working or not but here is the problem. I have a gridview that I databound to a dictionary<string, stringcollection: Contract StockContract = new Contract(); StockContract.Dictionary = ContractDictionary<string, string>(); GridView1.DataSource=StockContract.Dictionary; So far so good. Now I assign something to...
0
7911
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7839
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8200
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7954
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5710
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5390
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3864
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1448
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1179
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.