hi hi, i talked about this with you earlier but never gave you an answer!
in the end i prefer building the table if i know that there is going to be some maximum number of entries because, although picking a random dword is pretty fast (using the PRNG algorithm which d2 uses), doing a non-power of 2 division at each point is very slow (to get a number 1-n). so looping through the list once to get the total and (on average) half a time (actually usually much less than half, see below) to get the actual pick without calling rand(n) is better in many cases than looping through just once but doing a mod each time.
actually the half a time is often less than that as well, for on the first loop you are often culling out many of the entries. the main drawback being that you have to know ahead of time the maximum number of entries or have very fast memory allocation if you are being streamed the items from a remote source.
{edit} oh and regarding your post about durability: i think you must have done your research pre 1.08? I think the probabilities for durability loss changed with the expansion. re: smite, i put a breakpoint in, and it is indeed reducing the dur for your weapon (not your shield) when you smite.
in the end i prefer building the table if i know that there is going to be some maximum number of entries because, although picking a random dword is pretty fast (using the PRNG algorithm which d2 uses), doing a non-power of 2 division at each point is very slow (to get a number 1-n). so looping through the list once to get the total and (on average) half a time (actually usually much less than half, see below) to get the actual pick without calling rand(n) is better in many cases than looping through just once but doing a mod each time.
actually the half a time is often less than that as well, for on the first loop you are often culling out many of the entries. the main drawback being that you have to know ahead of time the maximum number of entries or have very fast memory allocation if you are being streamed the items from a remote source.
{edit} oh and regarding your post about durability: i think you must have done your research pre 1.08? I think the probabilities for durability loss changed with the expansion. re: smite, i put a breakpoint in, and it is indeed reducing the dur for your weapon (not your shield) when you smite.