-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathescape-bench-tasks.json
83 lines (83 loc) · 3.29 KB
/
escape-bench-tasks.json
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
{
// Integrate with External Tools via Tasks: https://go.microsoft.com/fwlink/?LinkId=733558
// Variables Reference: https://code.visualstudio.com/docs/editor/variables-reference
"version": "2.0.0",
"tasks": [
{
"label": "Go: Escape analysis, leaking + escapes",
"type": "shell",
"command": "cd $(echo '${fileDirname}') && go build -gcflags '-m=3 -l' 2>&1 | grep -E 'leaking param|escapes to heap' | while read -r line; do echo \"${relativeFileDirname}/${line}\"; done",
"problemMatcher": {
"pattern": {
"regexp": "^(.*):(\\d+):(\\d+): (.*)$",
"file": 1,
"line": 2,
"column": 3,
"message": 4
},
"fileLocation": [
"relative",
"${workspaceFolder}"
]
}
},
{
"label": "Go: Escape analysis, escapes only",
"type": "shell",
"command": "cd $(echo '${fileDirname}') && go build -gcflags '-m=3 -l' 2>&1 | grep -E 'escapes to heap' | while read -r line; do echo \"${relativeFileDirname}/${line}\"; done",
"problemMatcher": {
"pattern": {
"regexp": "^(.*):(\\d+):(\\d+): (.*)$",
"file": 1,
"line": 2,
"column": 3,
"message": 4
},
"fileLocation": [
"relative",
"${workspaceFolder}"
]
}
},
{
"label": "Go: Escape analysis, detailed, for current file and line",
"type": "shell",
"command": "cd $(echo '${fileDirname}') && go build -gcflags '-m=3 -l' 2>&1 | grep '^[^:]*${fileBasename}:${lineNumber}:'",
"problemMatcher": {
"pattern": {
"regexp": "$^"
}
}
},
{
"label": "Go: Profile current benchmark (memory)",
"type": "shell",
"command": "cd $(echo '${fileDirname}') && sed -n '${lineNumber}p' '${file}' | sed -n 's/func \\(.*\\)(.*/\\1/p' | xargs -I {} go test -bench=^{}$ -memprofile=mem.out -run='^$' && go tool pprof -http=:8080 mem.out",
"problemMatcher": {
"pattern": {
"regexp": "$^"
}
}
},
{
"label": "Go: Profile current benchmark (cpu)",
"type": "shell",
"command": "cd $(echo '${fileDirname}') && sed -n '${lineNumber}p' '${file}' | sed -n 's/func \\(.*\\)(.*/\\1/p' | xargs -I {} go test -bench=^{}$ -cpuprofile=cpu.out -run='^$' && go tool pprof -http=:8080 cpu.out",
"problemMatcher": {
"pattern": {
"regexp": "$^"
}
}
},
{
"label": "Environment",
"type": "shell",
"command": "echo workspaceFolder: '${workspaceFolder}', relativeFileDirname: '${relativeFileDirname}', fileDirname: '${fileDirname}', pwd: $(pwd)",
"problemMatcher": {
"pattern": {
"regexp": "$^"
}
}
}
]
}