mIRC Homepage
Posted By: coder how many lines can put in hash table ?? - 05/12/03 11:44 AM
may i know
How much RAM have you got? How big are the lines?
Posted By: coder Re: how many lines can put in hash table ?? - 05/12/03 12:55 PM
my ram is 192mb
and the current lines is 1330 lines
and will be increase to 9000 lines
can i do that just in one file of hash ?
Try this, might lock your mirc up for a while, maybe thats why they call them while loops smile
Code:
alias bigtable {
  hmake bigtable 10000
  var %x = 400000, %t = $ticks
  echo -a mIRC is about to lock up for a few seconds...
  while (%x) {
;    if (%x == 200000) { scon -a !ping $ticks }
    hadd bigtable %x big line of text with lots and lots or words here
    dec %x
  }
  echo -a I added $hget(bigtable,0).item items to bigtable in $calc($ticks -%t) milliseconds.
  ;hfree bigtable
}
 

I commented out a line there in the loop, you might want to uncomment it if you want to stay on the servers you are on.
It took my computer about 100 seconds to run that,

table is pretty big, the raw data without the item names is.
$bytes($calc($len(big line of text with lots and lots or words here) *400000)).suf
but im sure you can use all your ram for a hash table if you really need to.
You can also use this, and do whatever it is you want to do on mirc, and just let it take its course. You won't get booted offline, and it will just keep adding. Im not sure how long will take offhand, but it will allow you to stay online. >:P

Code:
alias bigtable {
  var %size = $iif($1, $1, 400000)
  /echo -s Creating a hash table with %size entries
  /hmake bigtable 10000
  /set %ticks_ = $ticks
  .timer 1 1 /bigtableadd %size
}

alias bigtableadd {
  var %x = $1 - 1
  if (%x > 0) {
    /hadd bigtable %x big line of text with lots and lots or words here
    .timer -m 1 1 bigtableadd %x
  }
  else {
    /echo -a I added $hget(bigtable,0).item items to bigtable in $calc($ticks -%t) milliseconds.
    /unset %ticks_
    /hfree bigtable
  }
}
Forget the tests.
The answer is: There is no limit on the number of items in a hash table. Unless of course you run out of RAM, but with 9000 items you probably aren't even using more than 10mb, so it's not really a limit you have to worry about.
Posted By: coder Re: how many lines can put in hash table ?? - 06/12/03 02:02 AM
thx to all of u
i dont expected that u guys willing to make a benchmark for that
thx...
so the conclusion is,there is no limit lines in hash tables smile
tX
© mIRC Discussion Forums