Re: What Impact Do Static HashTables and Classes have on the CPU?



Bruce,

I think you're on to something good here. Let's see what we can come up
with.

1. What are the keys in the hash table? What do they represent?
3. How are they structured?

The keys are GUID and they represent a collection data. A background process
grabs xml from the database and massages it into a struct of arrays.

So the keys are GUID and the values are a struct.

public static Hashtable myHash = Hashtable.Synchronized(new Hashtable());

public struct myStruct
{
public string html;
}

public static String myLogic(String targetID) {
if (myHash.Contains(targetID))
{
lock (myHash.SyncRoot)
{
struct myStruct = (struct)myHash[targetID];
// read data, make decisions based on data, update struct with
results
// struct of arrays greatly simplifed for sake of this
conversation
return myStruct.html;
}
}
}


2. How many keys can there be?

Currently 208, but that will grow to 500 in a couple months and in six
months up to 1000.


4. How (and when) can new keys be created?

Whenever data entry admins change data in the database the hashTable is
updated. This happens a couple hundred times a day. A background process
reads the live hash table, corrilates it's data with the incoming data,
contructs a new seperate hashTable, and once complete, locks the live
hashTable and does a quick swap.




.



Relevant Pages

  • [PATCH 13/24] CRED: Separate per-task-group keyrings from signal_struct [ver #7]
    ... from the cred struct rather than the signal_struct. ... #ifdef CONFIG_SECURITY ... * copy the keys in a thread group for fork without CLONE_THREAD ...
    (Linux-Kernel)
  • Re: associative array, container, mapping, terminology
    ... | struct key_and_value { ... I wrote a mapping library in C. ... of storing a value into an entry. ... Suppose we decided to represent keys thusly: ...
    (comp.programming)
  • VC6 -> VC2005 conversion problem
    ... struct SHomog ... static void CrossProduct(const SPoint& p, const SPoint& q, SHomog& r) ... returns number of keys ... enabled, disable normalization ...
    (microsoft.public.vc.mfc)
  • Re: associative array, container, mapping, terminology
    ... |> different kind of struct I consider to really be two different types. ... | but which kind isn't known at compile time, ... With homogenous keys and heterogenous data, my structs have the key appended ... I'm looking at having a mapping that is homogenous keys and homogenous data, ...
    (comp.programming)
  • Re: USB keyboard problem
    ... The keyboard_t struct kbd is passed to the ukbd_interrupt ... ukbd driver but within the mechanism that fills in ks_ndata. ... Once this has been done, a majority of the keys (a-z, 1-0 ... have found that when you hit any of the modifier keys, ...
    (freebsd-hackers)