-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathdbgp_benchmark.ahk
54 lines (49 loc) · 1.51 KB
/
dbgp_benchmark.ahk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/* DBGp test script
* A simple benchmark which was used to determine that Sleep 10
* in _DBGp_WaitHandler_Wait() was a massive bottleneck.
*/
#Requires AutoHotkey v2.0
#Include dbgp.ahk
Persistent
#NoTrayIcon
DBGp_OnBegin(TDebuggerConnected)
DBGp_OnEnd(TDebuggerDisconnected)
DBGp_StartListening()
Run '"' A_AhkPath '" /Debug nul'
TDebuggerConnected(dbg, initPacket) {
base64name := DBGp_Base64UTF8Encode("SciTE4AutoHotkey")
T()
Loop i := 100 {
dbg.property_set("-n A_DebuggerName -- " base64name)
response := dbg.property_get("-n A_DebuggerName")
dbg.feature_set("-n max_data -v 200")
dbg.feature_set("-n max_children -v 100")
dbg.feature_set("-n max_depth -v 0")
dbg.stdout("-c 2")
dbg.stderr("-c 2")
response := dbg.feature_get("-n supports_async")
}
D(T() / i / 8)
response := dbg.feature_get("-n max_data")
D("max_data " (InStr(response, ">200<") ? "pass" : "FAIL`n" response))
response := dbg.property_get("-n A_DebuggerName")
D("property " (InStr(response, ">" base64name "<") ? "pass" : "FAIL`n" response))
dbg.stop()
}
TDebuggerDisconnected(dbg) {
ExitApp
}
D(text, tag:="") {
if tag != ""
text := tag ": " text
FileAppend text "`n", "*"
}
T() {
local count, t
static freq := 0, last_count := 0
if !freq
DllCall("QueryPerformanceFrequency", "int64*", &freq)
DllCall("QueryPerformanceCounter", "int64*", &count := 0)
t := (count-last_count)/freq, last_count := count
return t
}