mIRC Home    About    Download    Register    News    Help

Print Thread
Eliminate "not responding" and trembling #251085 09/02/15 01:45 PM
Joined: Feb 2015
Posts: 18
E
EUDIS1980 Offline OP
Pikka bird
OP Offline
Pikka bird
E
Joined: Feb 2015
Posts: 18
Hi,

Having to load thousands of lines in a list by using a While loop, causes the list to tremble, flash, mirc goes in "not responding", and other disturbing effects. Has anyone faced such a situation? And how you resolved it?

Re: Eliminate "not responding" and trembling [Re: EUDIS1980] #251086 09/02/15 01:48 PM
Joined: Dec 2008
Posts: 1,511
westor Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,511
If you can provide us your code that is doing this maybe we can..

Re: Eliminate "not responding" and trembling [Re: westor] #251087 09/02/15 02:58 PM
Joined: Feb 2015
Posts: 18
E
EUDIS1980 Offline OP
Pikka bird
OP Offline
Pikka bird
E
Joined: Feb 2015
Posts: 18
It's nothing unusual, just a loop for loading .ini contents:

Code:
on *:dialog:msgdx:init:*:{
  mdx MarkDialog $dname
  mdx SetDialog $dname style tool title
  mdx SetControlMDX $dname 11 ListView grid rowselect report > views.mdx
  did -i $dname 11 1 headerdims 70 170 360 90
  did -i $dname 11 1 headertext $+(ID,$chr(9),NAME,$chr(9),MESSAGE,$chr(9),ACTION)
  did -f $dname 4
  .timer -h 1 50 dx.load $dname 11
}

alias dx.load {
  if ($dialog($1)) {
    var %tmp = 1, %tot = $ini("sysdata\dxtemp.ini",basic,0)
    while (%tmp <= %tot) {
      var %1 = $gettok($readini("sysdata\dxtemp.ini",basic,%tmp),1,33)
      var %2 = $gettok($readini("sysdata\dxtemp.ini",basic,%tmp),2,33)
      var %3 = $gettok($readini("sysdata\dxtemp.ini",basic,%tmp),3,33)
      var %4 = $gettok($readini("sysdata\dxtemp.ini",basic,%tmp),4,33)
      did -a $1 $2 $+(0 0 0 %1,$chr(9),%2,$chr(9),%3,$chr(9),%4)
      inc %tmp
    }
  }
}


File dxtemp.ini contains 3,400 records. When loading, the problem that i mentioned in my first post accurs.

Re: Eliminate "not responding" and trembling [Re: EUDIS1980] #251091 09/02/15 03:50 PM
Joined: Jan 2004
Posts: 1,282
L
Loki12583 Offline
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,282
mIRC is single threaded, the GUI ruins on the same thread as everything else so if you have a script that takes a long time to execute it holds up everything else mIRC is doing. Try refactoring the code to be more efficient. INI file access should already be pretty fast because it's supposed to be cached, but you may try loading the INI file to a hash table with the /hload command and looping over that. Referencing properties by their key is more efficient than looping over $hget().item. If this doesn't speed things up, instead of doing all 3,400 entries at once start a number of timers to stagger them.

Re: Eliminate "not responding" and trembling [Re: Loki12583] #251096 09/02/15 06:24 PM
Joined: Feb 2015
Posts: 18
E
EUDIS1980 Offline OP
Pikka bird
OP Offline
Pikka bird
E
Joined: Feb 2015
Posts: 18
I haven't even thought about using hash tables. I was trying using /loadbuf instead of a loop, but hashes work even faster. Thank you for your idea!