mIRC Home    About    Download    Register    News    Help

Print Thread
#220403 13/04/10 12:20 PM
Joined: Jan 2009
Posts: 116
K
Knoeki Offline OP
Vogon poet
OP Offline
Vogon poet
K
Joined: Jan 2009
Posts: 116
Well, not sure if this is really a bug, but here I go anyways.

With /hmake, you can specify the size of your hashtable. The manual claims that, depending on the number of items stored, the larger the size, the faster it will work.

Now, my bot stores quite a lot of (seen) data in a hashtable:

Code:
14:16:37 ~ | Knoeki^DSS      > !eval msg # $hget(seen, 0).item
14:16:37 & | Miffy           > 23705


23705 items as we speak. Now, this is all fine, since it works, but... why isn't it possible to create hash table with a size of over 10000 items, even though you can store unlimited items in it? Why a limit on the inital size if you can practically store an 'inifinte' amount of data in it anyways?

Knoeki #220407 13/04/10 01:49 PM
Joined: Oct 2004
Posts: 8,061
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Oct 2004
Posts: 8,061
Changing the initial size can improve performance, but only to a certain extent. I have a feeling you wouldn't see any real difference in speed between 10000 initial size and 75000 initial size, even with a lot of items.

Keep in mind that the initial size is best at 10% of the number of expected items. You currently have 23705 items. So your initial size should only be something like 2500 anyhow, or even 3000 if you want to assume you'll have another 6000+ items added. That's way below the 10000 limit.

Btw, this isn't a bug and should not be in the bugs forum. If you want something changed, it should go in the feature request forum.

Also, I hope you're not allowing !eval to evaluate any requested identifier. Doing so can very easily compromise your system.

Knoeki #220408 13/04/10 02:13 PM
Joined: Nov 2006
Posts: 1,552
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,552
You also might be interested in this thread smile


Link Copied to Clipboard