mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 2 1 2
#142586 18/02/06 05:49 PM
Joined: Apr 2004
Posts: 871
Sat Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2004
Posts: 871
A change in the timer management code - possibly linked to point 147 in versions.txt - now causes starting of many timers to be extremely slow. For example:

Code:
/timertest {
  var %i = 1, %t = $ticks
   while (%i <= 100) {
    .timer 1 5 !
    inc %i
  }
  echo -a on mirc $version $+ , it took $calc($ticks - %t) ms to start 100 timers
}

The results on my machine:

Quote:
on mirc 6.16, it took 47 ms to start 100 timers

on mirc 6.17, it took 1563 ms to start 100 timers

At least for me this is an unacceptable amount slower..


Saturn, QuakeNet staff
Joined: Apr 2004
Posts: 759
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Apr 2004
Posts: 759
confirmed here:
on mirc 6.16, it took 70 ms to start 100 timers
on mirc 6.17, it took 1061 ms to start 100 timers

this is a roughly 1500% increase of time frown.


$maybe
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Quote:
on mirc 6.16, it took 47 ms to start 100 timers
on mirc 6.17, it took 1563 ms to start 100 timers
At least for me this is an unacceptable amount slower..


What do u expect, hes having to do more code now to ensure they start in the order they are created, thus the longer create time.
You cant have your cake and eat it too.

Joined: Apr 2004
Posts: 871
Sat Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2004
Posts: 871
Apart from the fact that I never requested to eat this cake in the first place, maybe you would have had somewhat of a point if the time to create a timer increased as more timers were active. However, as qwerty pointed out to me, this is not the case: every timer creation takes about 10-15ms, regardless of the number of timers active at that moment. No code that checks a single timer could reasonably take 15 ms.


Saturn, QuakeNet staff
Joined: Dec 2002
Posts: 5,493
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,493
Indeed it does take more than 15ms: due to the way Windows differentiates and orders timers and WM_TIMER messages, in order to ensure that the timers are triggered in the correct order, mIRC has to ensure there is enough of a millisecond delay inbetween each timer so that Windows will correctly trigger them in the order that they were started. There are no plans to change this I'm afraid.

Joined: Apr 2004
Posts: 871
Sat Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2004
Posts: 871
It should be easy to let mIRC order them, instead of relying on Windows for this. I can help you with this if necessary, please let me know if you're interested. But in my opinion, having mIRC hang for 15ms every time a timer is started is really not an acceptable remedy for the relatively harmless issue of timer ordering. This cure is worse than the disease..

Actually I would guess that most scripts do not rely on ordering at all, so if you really don't want to fix this then I urge you to add a flag to /timer that orders the timer using this delay (or instead, negate this behaviour). Such timers should only have to be ordered in respect to other ordered timers anyway.


Saturn, QuakeNet staff
Joined: Nov 2004
Posts: 842
Hoopy frood
Offline
Hoopy frood
Joined: Nov 2004
Posts: 842
Quote:

on mirc 6.16, it took 78 ms to start 100 timers
on mirc 6.17, it took 1562 ms to start 100 timers


Does it really matter though since how many situations involve 100 timers being loaded at the same time?

I think a 1-2 sec lag is pretty easy to live with.


What do you do at the end of the world? Are you busy? Will you save us?
Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
I fully agree. Any way of getting the old, fast behaviour back would be great. I'm sure many picture window scripters would agree too, as timers are a frequently used tool in such scripts (including a few of mine, which now run considerably slower).


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Joined: Apr 2004
Posts: 871
Sat Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2004
Posts: 871
Quote:
Does it really matter though since how many situations involve 100 timers being loaded at the same time?

Yes it does matter. It could also be 100 scripts each using one timer. And it will be noticeable with far less than that.

Quote:
I think a 1-2 sec lag is pretty easy to live with.

You're kidding, right? We're not talking about network lag, but about mIRC being unresponsive for 1-2 sec, with a 100% CPU spike. If you find that acceptable, then you don't have a very fast PC to begin with..


Saturn, QuakeNet staff
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
Although I understand that Khaled wanted to fix this timer order issue, I also think the fix is worse than the "bugged" version. The difference in performance in some scripts is very noticable, and imho not worth it with the current implementation of the fix.

I hope this will be undone, done differently, or with a flag for those who really care about the order.


Gone.
Joined: Feb 2005
Posts: 681
M
Fjord artisan
Offline
Fjord artisan
M
Joined: Feb 2005
Posts: 681
The flag idea is a good one, this wasn't worth
the sacrifice of performance in my opinion.

Joined: Feb 2006
Posts: 32
Ameglian cow
Offline
Ameglian cow
Joined: Feb 2006
Posts: 32
Yeah, I'd agree, add a flag to use the old way, or get Sat to help you on this

Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
I think it would be more logical to provide a switch to enable the new method. That way, existing scripts will default to the old method, and anyone needing the high-order-resolution timers can add the switch.

-genius_at_work

Joined: Feb 2005
Posts: 681
M
Fjord artisan
Offline
Fjord artisan
M
Joined: Feb 2005
Posts: 681
This is what I meant as well, revert back to
the old and add a switch for the new method.

Joined: Jul 2003
Posts: 655
Fjord artisan
Offline
Fjord artisan
Joined: Jul 2003
Posts: 655
Agreed, only just noticed this myself while testing some changes on my multiserver script, for testing puposes i had as little as 20 servers and it was very much noticable. (not due to slow pc by any means). Reverting back to the old method and providing a flag to enable the new method would be great if at all possible.


"Allen is having a small problem and needs help adjusting his attitude" - Flutterby
Joined: Aug 2003
Posts: 72
V
Babel fish
Offline
Babel fish
V
Joined: Aug 2003
Posts: 72
I agree too, I would like to see a flag to enable or disable new timer ordering method

Joined: Jun 2003
Posts: 9
S
Nutrimatic drinks dispenser
Offline
Nutrimatic drinks dispenser
S
Joined: Jun 2003
Posts: 9
I agree. I would like to see a flag for timer ordering method.

Joined: Feb 2006
Posts: 1
T
Mostly harmless
Offline
Mostly harmless
T
Joined: Feb 2006
Posts: 1
The speed in which timer's are being executed on 6.17 is indeed 'unacceptable'. The ‘timer loop method’ which has been used by many scripters over the last few years is now almost useless. Version 6.17 has left only one fast method to perform multiple, repeated instruction on mIRC. This is through the use of while loops, which as we know consume 100% cpu usage, are unstable, and often cause mIRC to freeze.

I agree with the flag proposition. Ordered timer's are not worth the current drop in performance.

Joined: Mar 2004
Posts: 3
L
Self-satisified door
Offline
Self-satisified door
L
Joined: Mar 2004
Posts: 3
uff the diference its too big. the problem doesn't only affect picwinners.. the timers loops its the only way to do recursive calls and non-frosen iteractions... a speed decrease like that made useless too muchs of my scripts... frown


PD:my apollogies for mi english

Joined: Feb 2005
Posts: 681
M
Fjord artisan
Offline
Fjord artisan
M
Joined: Feb 2005
Posts: 681
Khaled: "As for the timer, I'll be changing it in the next version so that the ordering
only works when a switch is specified, so it will return back to it's normal speed.
" smile

Page 1 of 2 1 2

Link Copied to Clipboard