473,320 Members | 1,916 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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 2066
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**********@spammotel.com> wrote in message
news:Od**************@TK2MSFTNGP15.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., "dictionaries") 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 "dictionaries" , 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
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...
8
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...
26
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...
2
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...
1
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...
4
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...
4
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...
3
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
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...
2
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();...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.