mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 2 1 2
Timer starting time (6.17) #142586 18/02/06 05:49 PM
Joined: Apr 2004
Posts: 840
Sat Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2004
Posts: 840
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
Re: Timer starting time (6.17) #142587 18/02/06 06:20 PM
Joined: Apr 2004
Posts: 759
M
Mpdreamz Offline
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
Re: Timer starting time (6.17) #142588 18/02/06 09:47 PM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
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.

Re: Timer starting time (6.17) #142589 18/02/06 10:35 PM
Joined: Apr 2004
Posts: 840
Sat Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2004
Posts: 840
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
Re: Timer starting time (6.17) #142590 23/02/06 12:38 AM
Joined: Dec 2002
Posts: 4,538
Khaled Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 4,538
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.

Re: Timer starting time (6.17) #142591 23/02/06 01:01 AM
Joined: Apr 2004
Posts: 840
Sat Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2004
Posts: 840
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
Re: Timer starting time (6.17) #142592 23/02/06 01:04 AM
Joined: Nov 2004
Posts: 802
Jigsy Offline
Hoopy frood
Offline
Hoopy frood
Joined: Nov 2004
Posts: 802
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?
Re: Timer starting time (6.17) #142593 23/02/06 01:08 AM
Joined: Jan 2003
Posts: 2,523
Q
qwerty Offline
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
Re: Timer starting time (6.17) #142594 23/02/06 01:08 AM
Joined: Apr 2004
Posts: 840
Sat Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2004
Posts: 840
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
Re: Timer starting time (6.17) #142595 23/02/06 02:00 PM
Joined: Feb 2004
Posts: 2,019
FiberOPtics Offline
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.
Re: Timer starting time (6.17) #142596 23/02/06 02:18 PM
Joined: Feb 2005
Posts: 681
M
mIRCManiac Offline
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.

Re: Timer starting time (6.17) #142597 25/02/06 03:08 AM
Joined: Feb 2006
Posts: 32
Daveoh Offline
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

Re: Timer starting time (6.17) #142598 25/02/06 03:14 AM
Joined: Oct 2005
Posts: 1,741
G
genius_at_work Offline
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

Re: Timer starting time (6.17) #142599 25/02/06 06:44 PM
Joined: Feb 2005
Posts: 681
M
mIRCManiac Offline
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.

Re: Timer starting time (6.17) #142600 25/02/06 07:36 PM
Joined: Jul 2003
Posts: 655
Om3n Offline
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
Re: Timer starting time (6.17) #142601 26/02/06 02:16 PM
Joined: Aug 2003
Posts: 72
V
visionz Offline
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

Re: Timer starting time (6.17) #142602 26/02/06 09:45 PM
Joined: Jun 2003
Posts: 9
S
StanZ Offline
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.

Re: Timer starting time (6.17) #142603 27/02/06 12:54 AM
Joined: Feb 2006
Posts: 1
T
ToKeN_PicwinTk Offline
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.

Re: Timer starting time (6.17) #142604 28/02/06 12:23 AM
Joined: Mar 2004
Posts: 3
L
loele Offline
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

Re: Timer starting time (6.17) #142605 28/02/06 04:42 PM
Joined: Feb 2005
Posts: 681
M
mIRCManiac Offline
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