Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

ASP.NET Forum


You are currently viewing our ASP.NET Forum as a guest. Please register to participate.
Login



Reply
How to use HashTables in ASP?
Old 04-22-2008, 04:35 PM How to use HashTables in ASP?
Learning Newbie's Avatar
Defies a Status

Latest Blog Post:
Astounding Republican Paranoia
Posts: 5,662
Name: John Alexander
Trades: 0
I keep telling people it's impossible, but no one likes that answer. A customer of ours is still using ASP Classic like it's 1986, and they're paying us to fix the mess. They want us to use ASP so they can understand it, and so it integrates cleanly with the rest of their code, mainly session state. Their app gets a lot of traffic, sounds like hundreds of page requests per second.

There are about 140,000 items cached in a list at the application level. There's a six-byte key, and a struct value we need to look up using that key. Relational databases are too slow to get the data from, so it needs to be stored in memory. This takes about 2 MB of RAM, and there's only one copy in the entire app, so that's not an issue.

In ASP Classic, the way you might do this would be to store the items in an array and then iterate over it, looking for the key, and retrieve the value. This is way too slow. I thought about sorting the array and doing a binary search, but the keys change occasionally, so that's out.

Can you do something like Server.CreateObject("HashTable") or am I stuck writing a .NET class, exposing it to COM+, and then using it through interop? I don't understand the part about prime numbers quite well enough to write my own implementation.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
Learning Newbie is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 04-29-2008, 04:54 PM Re: How to use HashTables in ASP?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,515
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
A dictionary object would certainly be quicker than an array.
And take a look at Midori's ActiveX objects for one that's somewhat more robust than the MS one and comes with source code ( VB6 mind you )
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 03-18-2009, 07:00 PM Re: How to use HashTables in ASP?
Junior Talker

Posts: 1
Name: Laszlo
Trades: 0
OK - it's a year later - but have you tried something like this?

http://www.aspemporium.com/codelib.aspx?cid=12&pid=138

I haven't implemented such a thing myself; but I ran across it and was somewhat intrigued as to how well it would work in a real production setting and whether it's complexity would make it slower than a simple sort binary traversal having a worst-case O(n). This code is contrived out of two array lists and also uses legacy VBSCRIPT...

da Lizard
LoungeLizard is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to How to use HashTables in ASP?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.46216 seconds with 12 queries