mIRC Home    About    Download    Register    News    Help

Print Thread
how many lines can put in hash table ?? #62907 05/12/03 11:44 AM
Joined: Dec 2002
Posts: 60
C
coder Offline OP
Babel fish
OP Offline
Babel fish
C
Joined: Dec 2002
Posts: 60
may i know

Re: how many lines can put in hash table ?? #62908 05/12/03 12:43 PM
Joined: Nov 2003
Posts: 227
H
Hitchhiker Offline
Fjord artisan
Offline
Fjord artisan
H
Joined: Nov 2003
Posts: 227
How much RAM have you got? How big are the lines?

Re: how many lines can put in hash table ?? #62909 05/12/03 12:55 PM
Joined: Dec 2002
Posts: 60
C
coder Offline OP
Babel fish
OP Offline
Babel fish
C
Joined: Dec 2002
Posts: 60
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 ?

Re: how many lines can put in hash table ?? #62910 05/12/03 01:23 PM
Joined: Nov 2003
Posts: 227
H
Hitchhiker Offline
Fjord artisan
Offline
Fjord artisan
H
Joined: Nov 2003
Posts: 227
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.

Last edited by Hitchhiker; 05/12/03 01:24 PM.
Re: how many lines can put in hash table ?? #62911 05/12/03 07:10 PM
Joined: Jan 2003
Posts: 3,012
KingTomato Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
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
  }
}


-KingTomato
Re: how many lines can put in hash table ?? #62912 05/12/03 08:27 PM
Joined: Dec 2002
Posts: 2,962
S
starbucks_mafia Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
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.


Spelling mistakes, grammatical errors, and stupid comments are intentional.
Re: how many lines can put in hash table ?? #62913 06/12/03 02:02 AM
Joined: Dec 2002
Posts: 60
C
coder Offline OP
Babel fish
OP Offline
Babel fish
C
Joined: Dec 2002
Posts: 60
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