mIRC Homepage
Posted By: Rooster74 Hash tables question about speed and size - 02/03/03 08:58 PM
Would it be faster to have one large hash table for all my settings for several smaller ones?
Just a guess, but several smaller ones, so that the time to lookup a value is short (doesn't have to look though as many entries to find it)
I agree with NaquadaServ, better to split each set of values into individual hash tables, then they can be accessed much quicker.
Posted By: Hammer Re: Hash tables question about speed and size - 02/03/03 10:11 PM
For questions of this type, why not test it yourself? Write yourself a script that does both. One script uses several small hash tables and another script that uses a much larger one. The same exact script should be used to compare ... everything needs to be as much the same as possible so you don't inadvertantly try to test too many things at once. (Also, bear in mind that the OS will still necessarily be running, so this is only rudimentary profiling, at best, but you can minimize even those differences by closing down any processes not completely necessary to running the main OS and then rebooting when you're done testing to restart everything normally.)

In your profiling script, set a variable = $ticks to start the timer.

Do a loop that does the same operations 10000 times or more per test run. The longer the test, the more "normalized" your results will be. They will still vary, though; so, you will probably want to do several test runs for both methods.

At the end of each test, echo out $ticks - your stored $ticks value.

Close down all non-essential process including disconnecting mIRC (but not exiting) and start the test run.

Reboot to get back to normal.
© mIRC Discussion Forums