473,395 Members | 1,972 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,395 software developers and data experts.

Abysmal performance of Scripting.Dictionary object on 2003 server

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 big it slows down, but for normal operation it's no problem.

Recently our hosting provider moved to Windows Server 2003, and everything
went to the dogs. Pages that used to load in 2-3 seconds can now take in
excess of 30 seconds to load. I've done extensive profiling, and it seems
that the dictionary is to blame. Specifically, putting data into them.
Creating them is fine, getting results from the database is fine, adding
the key/value pairs is a nightmare.

The extreme difference in performance makes me think that the server is
out of memory and thrashing, but the provider insists that there is
plenty of free memory, and that my application is the only one with a
problem. Maybe I'm wrong, and it's a data marshalling issue, not a memory
allocation issue.

The paranoid side of me says that ASP is intentionally "unoptimised" in
2003 to "encourage" people to move to .NET.

Has anyone else seen this, or have any ideas what causes it?

Rodd

Jul 19 '05 #1
8 5546
Are you adding a lot of key/value pairs? Or adding a lot of data for a few
pairs?

I also use Scripting.Dictionary in several Classic ASP applications (mostly
for holding a list of potential user errors, and then accessing them when
producing "error summary" for the user), both on Windows 2000 and Windows
2003, and have noticed no perceptable difference. However, I'm not adding
much data (just a short error message), though potentially might add 25-30
key/value pairs.

Cheers
Ken

"Rodd Snook" <us****@nospam.snookums.port5.com> wrote in message
news:pa****************************@nospam.snookum s.port5.com...
: 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 big it slows down, but for normal operation it's no problem.
:
: Recently our hosting provider moved to Windows Server 2003, and everything
: went to the dogs. Pages that used to load in 2-3 seconds can now take in
: excess of 30 seconds to load. I've done extensive profiling, and it seems
: that the dictionary is to blame. Specifically, putting data into them.
: Creating them is fine, getting results from the database is fine, adding
: the key/value pairs is a nightmare.
:
: The extreme difference in performance makes me think that the server is
: out of memory and thrashing, but the provider insists that there is
: plenty of free memory, and that my application is the only one with a
: problem. Maybe I'm wrong, and it's a data marshalling issue, not a memory
: allocation issue.
:
: The paranoid side of me says that ASP is intentionally "unoptimised" in
: 2003 to "encourage" people to move to .NET.
:
: Has anyone else seen this, or have any ideas what causes it?
:
: Rodd
:
Jul 19 '05 #2
Ken Schaefer wrote:
Are you adding a lot of key/value pairs? Or adding a lot of data for a few
pairs?

I also use Scripting.Dictionary in several Classic ASP applications (mostly
for holding a list of potential user errors, and then accessing them when
producing "error summary" for the user), both on Windows 2000 and Windows
2003, and have noticed no perceptable difference. However, I'm not adding
much data (just a short error message), though potentially might add 25-30
key/value pairs.

Cheers
Ken

"Rodd Snook" <us****@nospam.snookums.port5.com> wrote in message
news:pa****************************@nospam.snookum s.port5.com...
: 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 big it slows down, but for normal operation it's no problem.
:
: Recently our hosting provider moved to Windows Server 2003, and everything
: went to the dogs. Pages that used to load in 2-3 seconds can now take in
: excess of 30 seconds to load. I've done extensive profiling, and it seems
: that the dictionary is to blame. Specifically, putting data into them.
: Creating them is fine, getting results from the database is fine, adding
: the key/value pairs is a nightmare.
:
: The extreme difference in performance makes me think that the server is
: out of memory and thrashing, but the provider insists that there is
: plenty of free memory, and that my application is the only one with a
: problem. Maybe I'm wrong, and it's a data marshalling issue, not a memory
: allocation issue.
:
: The paranoid side of me says that ASP is intentionally "unoptimised" in
: 2003 to "encourage" people to move to .NET.
:
: Has anyone else seen this, or have any ideas what causes it?
:
: Rodd

Scripting.Dictionary object had (has?) some threading issues; Eric
Lippert of Microsoft wrote it while learning about threading:
http://blogs.msdn.com/ericlippert/ar.../19/53054.aspx

There he talks about problems that can occur when using that object.

Possible cures:
There is a component, called "Lookup Table object", written by Microsoft
programmers who wanted better performance than the Dictionary object
provided. Perhaps you could use it.

BTW why use the Scripting.Dictionary object when you have Session and
Application variables available?

Good Luck,
Michael D. Kersey
Jul 19 '05 #3
"Michael D. Kersey" <md******@hal-pc.org> wrote in message
news:ug**************@TK2MSFTNGP10.phx.gbl...
: BTW why use the Scripting.Dictionary object when you have Session and
: Application variables available?

Because you might run into scoping issues. Session/Application objects are
global, and there is no way to make them "local" (or reduce their scope in
any way).

If I use a Script.Dictionary component, then I can limit the scope of that
component (eg to just a routine, or a page). I do not need to worry about
accidently over-writing some value on another page, or in another routine.

Also, I'm wary of adding lots of unnecessary stuff to Session or Application
objects. That makes your app unportable. I have plenty of applications that
I've having issues porting to .NET (or adding new features using .NET)
because of excessive overuse of Session variables, which makes it difficult
to run part of the app using ASP, and part using ASP.NET

Cheers
Ken
"Michael D. Kersey" <md******@hal-pc.org> wrote in message
news:ug**************@TK2MSFTNGP10.phx.gbl...
: Ken Schaefer wrote:
: > Are you adding a lot of key/value pairs? Or adding a lot of data for a
few
: > pairs?
: >
: > I also use Scripting.Dictionary in several Classic ASP applications
(mostly
: > for holding a list of potential user errors, and then accessing them
when
: > producing "error summary" for the user), both on Windows 2000 and
Windows
: > 2003, and have noticed no perceptable difference. However, I'm not
adding
: > much data (just a short error message), though potentially might add
25-30
: > key/value pairs.
: >
: > Cheers
: > Ken
: >
: > "Rodd Snook" <us****@nospam.snookums.port5.com> wrote in message
: > news:pa****************************@nospam.snookum s.port5.com...
: > : 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 big it slows down, but for normal operation it's no problem.
: > :
: > : Recently our hosting provider moved to Windows Server 2003, and
everything
: > : went to the dogs. Pages that used to load in 2-3 seconds can now take
in
: > : excess of 30 seconds to load. I've done extensive profiling, and it
seems
: > : that the dictionary is to blame. Specifically, putting data into them.
: > : Creating them is fine, getting results from the database is fine,
adding
: > : the key/value pairs is a nightmare.
: > :
: > : The extreme difference in performance makes me think that the server
is
: > : out of memory and thrashing, but the provider insists that there is
: > : plenty of free memory, and that my application is the only one with a
: > : problem. Maybe I'm wrong, and it's a data marshalling issue, not a
memory
: > : allocation issue.
: > :
: > : The paranoid side of me says that ASP is intentionally "unoptimised"
in
: > : 2003 to "encourage" people to move to .NET.
: > :
: > : Has anyone else seen this, or have any ideas what causes it?
: > :
: > : Rodd
: Scripting.Dictionary object had (has?) some threading issues; Eric
: Lippert of Microsoft wrote it while learning about threading:
: http://blogs.msdn.com/ericlippert/ar.../19/53054.aspx
:
: There he talks about problems that can occur when using that object.
:
: Possible cures:
: There is a component, called "Lookup Table object", written by Microsoft
: programmers who wanted better performance than the Dictionary object
: provided. Perhaps you could use it.
:
: BTW why use the Scripting.Dictionary object when you have Session and
: Application variables available?
:
: Good Luck,
: Michael D. Kersey
Jul 19 '05 #4
Probably, solution described in

http://support.microsoft.com/default...b;en-us;840875

Nick

"Rodd Snook" <us****@nospam.snookums.port5.com> wrote in message
news:pa****************************@nospam.snookum s.port5.com...
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 big it slows down, but for normal operation it's no problem.

Recently our hosting provider moved to Windows Server 2003, and everything
went to the dogs. Pages that used to load in 2-3 seconds can now take in
excess of 30 seconds to load. I've done extensive profiling, and it seems
that the dictionary is to blame. Specifically, putting data into them.
Creating them is fine, getting results from the database is fine, adding
the key/value pairs is a nightmare.

The extreme difference in performance makes me think that the server is
out of memory and thrashing, but the provider insists that there is
plenty of free memory, and that my application is the only one with a
problem. Maybe I'm wrong, and it's a data marshalling issue, not a memory
allocation issue.

The paranoid side of me says that ASP is intentionally "unoptimised" in
2003 to "encourage" people to move to .NET.

Has anyone else seen this, or have any ideas what causes it?

Rodd

Jul 19 '05 #5
On Wed, 26 May 2004 11:54:36 +0400, Nikolay wrote:
Probably, solution described in

http://support.microsoft.com/default...b;en-us;840875

Nick


Well, the performance hit isn't writing to the network because all my
responses are buffered, and I've done profiling which points the finger
squarely at the dictionary object. This article about RDS sounds closer
http://support.microsoft.com/default.aspx?kbid=555093
but I'm not using RDS (which goes over HTTP, hence the problem)

However, it sounds like 2003 server has some serious issues. I'm going to
move the application to another hosting provider who can supply win2k
boxes.

Rodd
Jul 19 '05 #6
On Tue, 25 May 2004 09:13:33 -0500, Michael D. Kersey wrote:
Ken Schaefer wrote:
Are you adding a lot of key/value pairs? Or adding a lot of data for a few
pairs?

I also use Scripting.Dictionary in several Classic ASP applications (mostly
for holding a list of potential user errors, and then accessing them when
producing "error summary" for the user), both on Windows 2000 and Windows
2003, and have noticed no perceptable difference. However, I'm not adding
much data (just a short error message), though potentially might add 25-30
key/value pairs.

Cheers
Ken

"Rodd Snook" <us****@nospam.snookums.port5.com> wrote in message
news:pa****************************@nospam.snookum s.port5.com...
: 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 big it slows down, but for normal operation it's no problem.
:
: Recently our hosting provider moved to Windows Server 2003, and everything
: went to the dogs. Pages that used to load in 2-3 seconds can now take in
: excess of 30 seconds to load. I've done extensive profiling, and it seems
: that the dictionary is to blame. Specifically, putting data into them.
: Creating them is fine, getting results from the database is fine, adding
: the key/value pairs is a nightmare.
:
: The extreme difference in performance makes me think that the server is
: out of memory and thrashing, but the provider insists that there is
: plenty of free memory, and that my application is the only one with a
: problem. Maybe I'm wrong, and it's a data marshalling issue, not a memory
: allocation issue.
:
: The paranoid side of me says that ASP is intentionally "unoptimised" in
: 2003 to "encourage" people to move to .NET.
:
: Has anyone else seen this, or have any ideas what causes it?
:
: Rodd Scripting.Dictionary object had (has?) some threading issues; Eric
Lippert of Microsoft wrote it while learning about threading:
http://blogs.msdn.com/ericlippert/ar.../19/53054.aspx

There he talks about problems that can occur when using that object.

Possible cures:
There is a component, called "Lookup Table object", written by Microsoft
programmers who wanted better performance than the Dictionary object
provided. Perhaps you could use it.


I was aware of the threading issues, and would like to move away from
dictionary objects so that I can more easily cache my data in session and
application scope. However, I have a lot of code that would need to be
rewritten, and no time to do it. Also, the current hosting environment
doesn't allow for the installation on 3rd-party components in most
situations. The code is also part of a product which is used outside of my
controlled hosting environment, and hence needs to be as portable as
possible.

BTW why use the Scripting.Dictionary object when you have Session and
Application variables available?


What Ken said. Plus, I have a good many of them organised in hierarchies
-- i.e. the values in some of the dictionary objects are other dictionary
objects. To answer his original question, I probably have two objects with
about 50 key/value pairs, but the values of each of these are themselves
dictionary objects with about 5-10 key/value pairs. Before you say "Lord!
That's an obscene amount.", I know it, and a lot of it could be cached at
the application level (in some other kind of data structure, or maybe even
as HTML), but the point is that the code performed acceptably on Win2k.

At the moment my preferred solution (apart from moving to another hosting
provider who has Win2k) is to rewrite the whole thing in .NET, or maybe
ASP/JScript or PHP (there, I said it!). Something with native support for
sparse, associative arrays and regular expressions.

Rodd

Jul 19 '05 #7
Rodd Snook wrote:
On Tue, 25 May 2004 09:13:33 -0500, Michael D. Kersey wrote: <snipped>
BTW why use the Scripting.Dictionary object when you have Session and
Application variables available?


What Ken said. Plus, I have a good many of them organised in hierarchies
-- i.e. the values in some of the dictionary objects are other dictionary
objects. To answer his original question, I probably have two objects with
about 50 key/value pairs, but the values of each of these are themselves
dictionary objects with about 5-10 key/value pairs. Before you say "Lord!
That's an obscene amount.", I know it, and a lot of it could be cached at
the application level (in some other kind of data structure, or maybe even
as HTML), but the point is that the code performed acceptably on Win2k.

So a total of ~500-1000 items: not many, although we know nothing of
their content and, if they're built up and then discarded with each
page, that's a lot of overhead.

Are these dictionary objects running at low, medium(pooled) or high
(Isolated) protection level or running remotely?

Are they saved in the Session or Application objects or to files or a
database between page executions, or are they created and rebuilt with
each page execution?
At the moment my preferred solution (apart from moving to another hosting
provider who has Win2k) is to rewrite the whole thing in .NET, or maybe
ASP/JScript or PHP (there, I said it!). Something with native support for
sparse, associative arrays and regular expressions.

That would be Perl ( http://www.ActiveState.com/ ).
Jul 19 '05 #8
On Fri, 28 May 2004 00:20:47 -0500, Michael D. Kersey wrote:
Rodd Snook wrote:
On Tue, 25 May 2004 09:13:33 -0500, Michael D. Kersey wrote: <snipped>
BTW why use the Scripting.Dictionary object when you have Session and
Application variables available?


What Ken said. Plus, I have a good many of them organised in hierarchies
-- i.e. the values in some of the dictionary objects are other dictionary
objects. To answer his original question, I probably have two objects with
about 50 key/value pairs, but the values of each of these are themselves
dictionary objects with about 5-10 key/value pairs. Before you say "Lord!
That's an obscene amount.", I know it, and a lot of it could be cached at
the application level (in some other kind of data structure, or maybe even
as HTML), but the point is that the code performed acceptably on Win2k.

So a total of ~500-1000 items: not many, although we know nothing of
their content and, if they're built up and then discarded with each
page, that's a lot of overhead.

Are these dictionary objects running at low, medium(pooled) or high
(Isolated) protection level or running remotely?


That's a good question, but I'm not sure of the answer. The environment
that's giving problems is a shared server at a hosting provider, so I
can't check on the configuration. I'm also not familiar with the
configuration of Win2k3 and IIS6. Apparently each customer "slot" has it's
own application pool, so I'm guessing that the ASP application is
isolated. The Dictionary object is in-process by default in NT4 and Win2k,
and I would imagine that is also the case on Win2k3, but I may be wrong.

Are they saved in the Session or Application objects or to files or a
database between page executions, or are they created and rebuilt with
each page execution?


They are rebuilt from the database with each page execution. I agree that
this is a lot of overhead, but the application performs acceptably on
Win2k. I would cache them at the application level if it weren't for the
threading limitation of the object.

At the moment my preferred solution (apart from moving to another hosting
provider who has Win2k) is to rewrite the whole thing in .NET, or maybe
ASP/JScript or PHP (there, I said it!). Something with native support for
sparse, associative arrays and regular expressions.

That would be Perl ( http://www.ActiveState.com/ ).


PHP and JScript have these features too, but are semantically closer to
VBScript and thus the porting would be easier.
Jul 19 '05 #9

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

Similar topics

9
by: What-a-Tool | last post by:
Dim MyMsg Set MyMsg = server.createObject("Scripting.Dictionary") MyMsg.Add "KeyVal1", "My Message1" MyMsg.Add "KeyVal2", "My Message2" MyMsg.Add "KeyVal3", "My Message3" for i = 1 To...
2
by: Tim Chmielewski | last post by:
I have been trying to read values from a form into an array on a page without much success and was told to use a Scripting.Dictionary instead. There are a variable number of fields on the form as...
2
by: Vaibhav | last post by:
dear all, i wonder if someone help me.. i am trying the create a dictionary obejct in asp but its giving the error Error Type: (0x8002801D) Library not registered
17
by: Karl Irvin | last post by:
To use the Textstream object, I had to set a Reference to the Microsoft Scripting Runtime. This works good with A2000 Is the Scripting Runtime included with A2002 and A2003 so the Reference...
1
by: Adnan | last post by:
Hi, I am porting an existing ASP applcation to ASP.NET which heavily depends on Mainpulation through Scripting.Dictionary. Can anyone help me out with an alternative to use of Scripting.Dictionary....
8
by: Howard Kaikow | last post by:
Historically, auntie virus software has issued false positives against code using the Scripting Runtime. Does .NET have a native replacement for the Scripting runtime? For example, is there...
6
by: Oenone | last post by:
Could someone suggest a good native .Net collection object that provides similar functionality to the COM Scripting.Dictionary object? Specifically I need to be able to add items with an...
19
by: Tom Jastrzebski | last post by:
Hello, I was just testing VB.Net on Framework.Net 2.0 performance when I run into the this problem. This trivial code attached below executed hundreds, if not thousand times faster in VB 6.0...
3
by: jaffar.kazi | last post by:
Hi All, I have a VB COM component that has an object of type Scripting.Dictionary. Each element of this again has Scripting.Dictionary type members. I need to access this in C#, and am not able...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.