Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I need a FAST dictionary or alternative. 3

Status
Not open for further replies.

Geates

Programmer
Aug 25, 2009
1,566
US
I'm creating a basic asset managment HTA for my organization. When a user logs onto a domain computer, a logon script audits the machine for system information and stores it in a SQLDB.

A portion of the program displays asset attributes and the "as of" timestamp. Currently, I'm storing the attributes and timestamps in a dictionary object to make use of the key=>value context. My current code does what it needs to do in .0156 secs per asset. However, when you got over 1500 assets, it tends to slow things down.

Aside from limiting the number of assets displayed, can anyone offer some insight on speeding up this code? Or an alternative solution?

Code:
set dicItems = CreateObject("Scripting.Dictionary")

for j = 0 to ubound(arrRows) - 1
   arrItem = arrRows(j)
   if (arrItem(0) = intAssetPK) then
      if (dicItems.Exists(arrItem(1)) = false) then
         dicItems.Add arrItem(1), arrItem(2)
      end if
   end if
next

NOTE: An assets list of attributes is dynamic and created based on the information available at audit.

NOTE: My DB is an EAV and thus has little to no literal context (just numbers pointing at numbers :) ).

-Geates
 
OK, early binding and others or whatever... I just don't have time to expand on the peripheral and don't even have the patient to digest and response to those. You know better, ok?
 
strongm,

I implemented your suggestion of using a disconnected RS and was able to eliminate the need for a dictionary altogether. Using a With loop, I could work with the RS data without having to reconcile it first. Overhead disappeared and performance substantially increased.

Thanks!

-Geates
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top