mIRC Homepage
Posted By: OrionsBelt Max size of hash table data - 30/08/07 01:15 PM
Does anyone know how many characters can be placed in an hash table data?

Basicly, I want to make a table that holds comments.
So: <table> <id> <comment>

But before storing this comment, I want to make sure, that it doens't exceed the maximum amount of characters the table can hold.
if ($len(%comment) < x) {

So, what's the max?
Or, what's a safe length to use?

Thanks smile
Posted By: Wims Re: Max size of hash table data - 30/08/07 01:20 PM
The length is different according to people but 930 is a safe length
Posted By: OrionsBelt Re: Max size of hash table data - 30/08/07 01:24 PM
Aight, 930 it is then laugh

Thx a lot Wims!
Posted By: Horstl Re: Max size of hash table data - 30/08/07 01:32 PM
My testing: $len(tablename + item + data) has to be <= 939
Code:
alias lentest {
hadd -sm $1 $2 $str(x,$3)
echo -a LEN: tablename $len($1) item $len($2) data $len($hget($1,$2)) total: $calc($len($1) + $len($2) + $len($hget($1,$2)))
 hfree $1
}

/lentest a a 937 >> LEN: tablename 1 item 1 data 937 total: 939
/lentest a a 938 >> line too long

/lentest aaa a 935 >> LEN: tablename 3 item 1 data 935 total: 939
/lentest aaa a 936 >> line too long

/lentest a ab 936 >> LEN: tablename 1 item 2 data 936 total: 939
/lentest a ab 937 >> line too long


...the max len of %vars is likely: $len(varname (including the % char) + data) has to be <= 942

Code:
alias lentest2 {
set -u $+(%,$1) $str(x,$2)
echo -a LEN: varname $len($var($+($1,*),1)) data $len($($var($+($1,*),1),2)) total: $calc($len($var($+($1,*),1)) + $len($($var($+($1,*),1),2)))
}

/lentest2 testing 934 >> LEN: varname 8 data 934 total: 942
/lentest2 testing 935 >> line too long

/lentest2 ab 939 >> LEN: varname 3 data 939 total: 942
/lentest2 ab 940 >> line too long

smile
Posted By: OrionsBelt Re: Max size of hash table data - 30/08/07 01:54 PM
lol!

Alright awesome, I wanna be sure that I won't have any problems, so I've limited it to 900 characters.
900 is quite sufficiant for a proper note, and I'm rather safe then sorry.

Thanks for your tests Horstl!
Posted By: Horstl Re: Max size of hash table data - 22/05/08 06:01 AM
*dump* laugh
As you may have noticed, new mIRC 6.32 brought about some alternation (extension) to these limits:
Originally Posted By: versions.txt
12.Standardized and extended string lengths throughout mIRC to allow the use of longer variables, channel and nick names, and other items.

FYI (and mine, of course) here are some of the *new* limits, according to my tests:

max hash len (tablename + item + data): v6.31: 939 - v6.32: 4140
max var len (varname(including the % char) + data): v6.31: 942 - v6.32: 4143
max line len (echo): v6.31: 942 - v6.32: 4143
max window name len (including @): v6.31: 90 - v6.32: 256
© mIRC Discussion Forums