mIRC Home    About    Download    Register    News    Help

Print Thread
#204738 29/09/08 10:02 PM
Joined: Oct 2003
Posts: 110
D
Vogon poet
OP Offline
Vogon poet
D
Joined: Oct 2003
Posts: 110
What would be typically used to measure where time is spent?(in scripts)

I am frequently experiencing freezes of 5-10s in my vista64 mirc and I'm not too sure where it comes from.(It only seems to happen after a few days of use though, so it's hard to debug, I am actually wondering if it might be some sort of gdi fragmentation or something)

I only have aliases defined, and a dozen very specific on TEXT/on NOTICE, which are almost never run through...
So the slowdowns do not make sense.

Last edited by DeathWolf; 29/09/08 10:10 PM.
Joined: Jul 2006
Posts: 4,149
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,149
when testing something, you can use $ticks to measure the execution time :

Code:
alias benchmark {
var %ticks = $ticks
;your script here
echo -a execution in $calc($ticks - %t) ms
}
This is a basic exemple.


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
1. $ticks - %t is not a milliseconds value.
2. That wouldn't really help pinpoints slowdowns in a large blackbox as Deathwolf is describing.

@Deathwolf: Unfortunately, there's no way to tell what part of a script is slowing you down besides manually testing each event independently of others. I'd unload scripts until the slowdown is gone then focus on the last file you unloaded... assuming you have scripts loaded.

Also look at loaded dlls by typing //echo -a $dll(0) to see if you have any loaded and then $dll(1) $dll(2) ... to the number returned by $dll(0) to see each file. You can unload them with //dll -u $dll(N)


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Joined: Jul 2006
Posts: 4,149
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,149
I've just answered the question, and could you say then, which value is "$ticks - %t" ?


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
$ticks does indeed return a value in milliseconds, however it's accuracy is variable depending on the system on which mIRC is running.

http://msdn.microsoft.com/en-us/library/ms724408(VS.85).aspx

Joined: Jul 2006
Posts: 4,149
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,149
$ticks as an accuracy between 10-15 ms, depending on the system as you said, but it's not important here


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Oct 2003
Posts: 110
D
Vogon poet
OP Offline
Vogon poet
D
Joined: Oct 2003
Posts: 110
Originally Posted By: argv0
1. $ticks - %t is not a milliseconds value.
2. That wouldn't really help pinpoints slowdowns in a large blackbox as Deathwolf is describing.

@Deathwolf: Unfortunately, there's no way to tell what part of a script is slowing you down besides manually testing each event independently of others. I'd unload scripts until the slowdown is gone then focus on the last file you unloaded... assuming you have scripts loaded.

Also look at loaded dlls by typing //echo -a $dll(0) to see if you have any loaded and then $dll(1) $dll(2) ... to the number returned by $dll(0) to see each file. You can unload them with //dll -u $dll(N)


No dlls loaded...

Symptoms:
-mIRC has bursts of unresponsiveness where nothing happens(cant type or view anything, it's stuck in redraw.
-CPU usage usually saturates during those, with ~50% of kernel usage.
-the symptom usually appears after a few days of heavy use of mirc.(I usually have a largely 3 digit count of windows)
-unloading scripts does not help
-it typically seems to happen when I type

When I check the stack it's never interesting(ie, not stuck in a particular call).

Any ideas?

OS: windows server 2008 64bit
Memory: 4GB of ram(never filled, lots of it free)
CPU: Core 2 Q6600 also mostly idle

Last edited by DeathWolf; 01/10/08 09:26 PM.
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
Does it typically seem to happen when you're typing *unicode* characters? Font linking could cause slowdowns.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Joined: Oct 2003
Posts: 110
D
Vogon poet
OP Offline
Vogon poet
D
Joined: Oct 2003
Posts: 110
not typically, I'll try turning it off though.

Joined: Oct 2003
Posts: 110
D
Vogon poet
OP Offline
Vogon poet
D
Joined: Oct 2003
Posts: 110
Apparently this did not help...

I am still getting freezes that sometimes last more than 10seconds fully using the cpu.
(which indicates quite serious activity considering it's a Q6600)

Last edited by DeathWolf; 03/10/08 03:35 AM.
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
It freezes your entire machine or just mIRC? There is always the possibility that it's not mIRC at all-- some AV or firewall software could be responsible for freezing mirc, or perhaps your entire cpu is slowing down caused by a completely different prcoess.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Joined: Oct 2003
Posts: 110
D
Vogon poet
OP Offline
Vogon poet
D
Joined: Oct 2003
Posts: 110
Could anyone suggest a snippet to write all activity to a debug file with precise timestamps?
I might be able to identify the cause of the freezes then.(by checking which was the last received bunch of text)
It would have to be multiserver @debug in a single window since I'm connected to multiple servers.

Originally Posted By: argv0
It freezes your entire machine or just mIRC? There is always the possibility that it's not mIRC at all-- some AV or firewall software could be responsible for freezing mirc, or perhaps your entire cpu is slowing down caused by a completely different prcoess.

I've tried disabling the av, and the av logs indicate no activity.
Same with firewall.
Also the cpu charts clearly indicate it's mirc using the cpu, not another process.(I have charts of the cpu used by mirc clearly showing the usage)

Last edited by DeathWolf; 04/10/08 02:15 PM.

Link Copied to Clipboard