mIRC Home    About    Download    Register    News    Help

Print Thread
Encourage reading in While $hget #263006 07/05/18 06:54 PM
Joined: May 2018
Posts: 6
R
RoK Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
R
Joined: May 2018
Posts: 6

Hello, it is possible in an update that hash tables
were faster at the time of reading the entire table?

For example, a loop

fopen ..
While (!$Feof) && (!$Ferr)

it's much faster than

While ($hget(n,%a).item)

Is there a big difference, could this be enhanced?

Thank you

Re: Encourage reading in While $hget [Re: RoK] #263007 07/05/18 07:10 PM
Joined: Jul 2006
Posts: 3,582
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,582
You can use $hfind(table,*,0,w,echo -a $1-) to get all the item, this is much faster.


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: Encourage reading in While $hget [Re: Wims] #263054 20/05/18 07:46 PM
Joined: May 2018
Posts: 6
R
RoK Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
R
Joined: May 2018
Posts: 6
Yes but there is no option to use a dll called WhileFix.dll that freezes the loop and allows it to not get stuck, it is only for While

Re: Encourage reading in While $hget [Re: RoK] #263055 21/05/18 12:39 AM
Joined: Feb 2003
Posts: 2,666
Raccoon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,666
Why would anyone want to use such a .dll like that? Sounds like an ill-conceived concept, "whilefix". There's nothing broken about While.

If you're having a problem with loops taking too long to complete, the problem lies in your approach, not the platform. Consider what data you're trying to access, and how you can access it more efficiently, prefetch, in segments, or whatever translates into the minimum amount of work that's actually necessary.

What is the data you are working with, why do you need to traverse IT ALL, on demand, when?

I have worked with hash tables containing 6 million items. It's not an issue if you plan ahead.


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
Re: Encourage reading in While $hget [Re: Raccoon] #263056 21/05/18 01:01 PM
Joined: May 2018
Posts: 6
R
RoK Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
R
Joined: May 2018
Posts: 6
sounds crazy but I have made an irc server and I find it very slow when a channel there are about 300 users the ircd must send all the ones inside the channel the JOIN and the one that comes in there, hence the idea of ​​freezing the loops so that mirc does not get stuck

Re: Encourage reading in While $hget [Re: RoK] #263057 21/05/18 03:46 PM
Joined: Jan 2004
Posts: 1,212
maroon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 1,212
Are you trying to say you're making a mIRC script be the ircd itself? If you're sending the JOIN message when someone joins, you're also sending 300 messages each time someone chats a message to the channel too, as well as a whole lotta other events like /nick /part /quit /ban /kick /action etc.

Re: Encourage reading in While $hget [Re: maroon] #263058 21/05/18 06:09 PM
Joined: May 2018
Posts: 6
R
RoK Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
R
Joined: May 2018
Posts: 6
If, therefore, more users the longer is the while, and all this each sock has its own data buffer, the problem is that it is blocked and has a considerable delay, hence the idea of ​​using WhileFix

And mIRC 7.52 has an error with the / timer, they stop working

Re: Encourage reading in While $hget [Re: RoK] #263059 21/05/18 08:14 PM
Joined: Jan 2004
Posts: 1,212
maroon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 1,212
Is there a simple snippet where you can demonstrate a /timer stops working?

Re: Encourage reading in While $hget [Re: maroon] #263086 25/05/18 01:56 PM
Joined: May 2018
Posts: 6
R
RoK Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
R
Joined: May 2018
Posts: 6

I do not cause it

Re: Encourage reading in While $hget [Re: RoK] #263088 25/05/18 02:29 PM
Joined: Jul 2006
Posts: 3,582
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,582
If mIRC is under extreme load, timers will stop working yes, but only in these extreme cases, saying timers are not working is a bit vague because a lot of users are using timers as we speak on 7.52, probably without any issue. If your timer are stopping because mirc is processing a lot of things, then it probably wouldn't work either with whilefix, otherwise, can you describe how to get timers to stop?


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net