tg,
the hash table may be sparse, so direct index is impossible, instead, the way I recall the hash tables work is that there is a some function that will bring you within the range of the sought value, and from there you get to the right value in linear fashion. The time it takes to complete is fixed, independent of N.
So when Kap ran the scenarios, the time it takes to lookup the right value in the hash table does not change from 1,000 to 10,000 cases, meaning it has no bearing on the execution time, meaning that even if there are differences between Piii and P4 in the way and the time it takes to execute the lookup, it is a constant value.
Suppose the constant is 100 cycles for Piii, and 200 cycles for P4. These are irrelevant compared to incremental time added by executing the case statement for 1000s cases x 3.5 cycles per case of Piii, or 1000s of cases x 7 clock cycles of P4. There may be a way to calculate this constant by running the loop for very few cases, with good timing.
Joe |