- Joined
- Oct 11, 2012
- Messages
- 711
Hi guys, I wonder how hashtable access its data, please see the following example:
Edit:
I know that with more data stored in one hashtable, the accessing speed decreases. So do the two examples have the same reduction in terms of accessing speed?
How about creating a unit inside of a hashtable? Is it inefficient? If so, why?
JASS:
function example takes nothing returns nothing
...
call SaveReal(hash,98765432,0,1)
....
call LoadReal(hash,98765432,0)
endfunction
//Compare to the following parent key
function example takes nothing returns nothing
...
call SaveReal(hash,1,0,1)
....
call LoadReal(hash,1,0)
endfunction
//The acessing speed is different and my questions are:
//1. how big of a difference does it make?
//2. in the first example, does the parent key value got accessed immediately? or is it added up from 0 to 98765432? I hope this makes sense. :D
// I mean how does hashtable access its keys?
//3. how about using hex number as parent key? Is it faster in that way? (I don't think so but not sure)
Edit:
I know that with more data stored in one hashtable, the accessing speed decreases. So do the two examples have the same reduction in terms of accessing speed?
How about creating a unit inside of a hashtable? Is it inefficient? If so, why?
JASS:
function example takes nothing returns nothing
call SaveUnitHandle(hash,0,0,CreateUnit(.....))
endfunction