Skip to content

Commit 215c61e

Browse files
Render collector invocations for local benchmarking
This just renders it with cachegrind pre-selected, but that can be easily modified locally. Should provide a reasonable "default" on-ramp, though. Currently using some CSS to force selection to the code block as a whole instead of subparts, but maybe this is too weird. Does make copying pretty quick.
1 parent a2a7e01 commit 215c61e

File tree

1 file changed

+32
-1
lines changed

1 file changed

+32
-1
lines changed

site/static/detailed-query.html

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,13 @@
5252
[data-sorted-by="asc"]::after {
5353
content: "▼";
5454
}
55+
56+
/* Per MDN -- https://developer.mozilla.org/en-US/docs/Web/HTML/Element/code */
57+
code {
58+
background-color: #eee;
59+
border-radius: 3px;
60+
user-select: all;
61+
}
5562
</style>
5663
</head>
5764

@@ -184,11 +191,35 @@ <h3 id="title"></h3>
184191
(${speedscope_link(state.commit, state.benchmark, state.run_name)},
185192
${firefox_profiler_link(state.commit, state.benchmark, state.run_name)})
186193
results for ${state.commit.substring(0, 10)} (new commit)`;
194+
let profile = b => b.endsWith("-opt") ? "Opt" :
195+
b.endsWith("-doc") ? "Doc" :
196+
b.endsWith("-debug") ? "Debug" :
197+
b.endsWith("-check") ? "Check" : "???";
198+
let bench_name = b => b.replace(/-[^-]*$/, "");
199+
let run_filter = r => r == "full" ? "Full" :
200+
r == "incr-full" ? "IncrFull" :
201+
r == "incr-unchanged" ? "IncrUnchanged" :
202+
r.startsWith("incr-patched") ? "IncrPatched" :
203+
"???";
187204
if (state.base_commit) {
188205
txt += "<br>";
189-
txt += `Diff: <a
206+
txt += `Diff: <a
190207
href="/perf/processed-self-profile?commit=${state.commit}&base_commit=${state.base_commit}&benchmark=${state.benchmark}&run_name=${state.run_name}&type=codegen-schedule"
191208
>codegen-schedule</a>`;
209+
txt += "<br>Local profile (base): <code>" +
210+
`./target/release/collector profile_local cachegrind
211+
+${state.base_commit} --include ${bench_name(state.benchmark)} --builds
212+
${profile(state.benchmark)} --runs ${run_filter(state.run_name)}</code>`;
213+
}
214+
txt += "<br>Local profile (new): <code>" +
215+
`./target/release/collector profile_local cachegrind
216+
+${state.commit} --include ${bench_name(state.benchmark)} --builds
217+
${profile(state.benchmark)} --runs ${run_filter(state.run_name)}</code>`;
218+
if (state.base_commit) {
219+
txt += "<br>Local profile (diff): <code>" +
220+
`./target/release/collector diff_local cachegrind
221+
+${state.base_commit} +${state.commit} --include ${bench_name(state.benchmark)} --builds
222+
${profile(state.benchmark)} --runs ${run_filter(state.run_name)}</code>`;
192223
}
193224
document.querySelector("#raw-urls").innerHTML = txt;
194225
let sort_idx = state.sort_idx;

0 commit comments

Comments
 (0)