Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dictionary/Client VS Application Variables

Hi i got a question about my server performance ... i got a classic asp cms hosting ~250 websites, for each website we build a Classic ASP dictionary using

set dict = CreateObject("Scripting.Dictionary") 
dict.add "test1","Value Test1"
dict.add "test2","Value Test2"
dict.add "test3","Value Test3"

that dictionary is then loaded on every page for every user ...

lets say we got about ~150 000 users visiting those websites monthly loading those dictionary of about ~100k each every load ...

should i use application variable as dictionary instead of loading my dictionary every time?

and is it really gonna improve my server performance?

like image 756
Lil'Monkey Avatar asked Oct 15 '22 13:10

Lil'Monkey


1 Answers

Certainly loading a dictionary for every ASP request is definitely a bad idea and will be hurting not only your performance but also fragmenting your Virtual Memory.

Using an array instead still has much the same problem, each request would need to allocate all the memory needed to hold it and it still needs populating on each request.

The simple answer would be yes use the application object as the dictionary. This will cost you much less in memory and CPU. The downside is does it collide with existing application object usage? You may need to prefix your keys in order to avoid this problem.

like image 147
AnthonyWJones Avatar answered Oct 30 '22 17:10

AnthonyWJones