Skip to content
This repository has been archived by the owner on Dec 6, 2024. It is now read-only.

Commit

Permalink
fixup 500 error
Browse files Browse the repository at this point in the history
  • Loading branch information
aureleoules committed Jan 24, 2024
1 parent 8424f3d commit 12ff64d
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/routes/[owner]/[repo]/pulls/[number]/Benchmarks.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,20 @@
}
function getUnit(benchmark) {
if (!report.benchmarks_grouped[benchmark]) return "";
return report.benchmarks_grouped[benchmark]["unit"];
}
function getNsPerUnit(benchmark) {
if (!report.benchmarks_grouped[benchmark]) return 0;
return (
report.benchmarks_grouped[benchmark]["median(elapsed)"] /
(0.000000001 * report.benchmarks_grouped[benchmark]["batch"])
);
}
function getNsPerUnitMaster(benchmark) {
if (!report.base_report.benchmarks_grouped[benchmark]) return 0;
return (
report.base_report.benchmarks_grouped[benchmark][
"median(elapsed)"
Expand All @@ -50,41 +53,47 @@
}
function getNsPerUnitDiff(benchmark) {
if (!report.base_report.benchmarks_grouped[benchmark]) return 0;
return (
(getNsPerUnit(benchmark) - getNsPerUnitMaster(benchmark)) /
getNsPerUnitMaster(benchmark)
);
}
function getUnitPerSecond(benchmark) {
if (!report.benchmarks_grouped[benchmark]) return 0;
return (
report.benchmarks_grouped[benchmark]["batch"] /
report.benchmarks_grouped[benchmark]["median(elapsed)"]
);
}
function getUnitPerSecondMaster(benchmark) {
if (!report.base_report.benchmarks_grouped[benchmark]) return 0;
return (
report.base_report.benchmarks_grouped[benchmark]["batch"] /
report.base_report.benchmarks_grouped[benchmark]["median(elapsed)"]
);
}
function getUnitPerSecondDiff(benchmark) {
if (!report.base_report.benchmarks_grouped[benchmark]) return 0;
return (
(getUnitPerSecond(benchmark) - getUnitPerSecondMaster(benchmark)) /
getUnitPerSecondMaster(benchmark)
);
}
function getIPC(benchmark) {
if (!report.benchmarks_grouped[benchmark]) return 0;
return (
report.benchmarks_grouped[benchmark]["median(instructions)"] /
report.benchmarks_grouped[benchmark]["median(cpucycles)"]
);
}
function getIPCMaster(benchmark) {
if (!report.base_report.benchmarks_grouped[benchmark]) return 0;
return (
report.base_report.benchmarks_grouped[benchmark][
"median(instructions)"
Expand All @@ -96,20 +105,23 @@
}
function getIPCDiff(benchmark) {
if (!report.base_report.benchmarks_grouped[benchmark]) return 0;
return (
(getIPC(benchmark) - getIPCMaster(benchmark)) /
getIPCMaster(benchmark)
);
}
function getCyclesPerUnit(benchmark) {
if (!report.benchmarks_grouped[benchmark]) return 0;
return (
report.benchmarks_grouped[benchmark]["median(cpucycles)"] /
report.benchmarks_grouped[benchmark]["batch"]
);
}
function getCyclesPerUnitMaster(benchmark) {
if (!report.base_report.benchmarks_grouped[benchmark]) return 0;
return (
report.base_report.benchmarks_grouped[benchmark][
"median(cpucycles)"
Expand All @@ -118,20 +130,23 @@
}
function getCyclesPerUnitDiff(benchmark) {
if (!report.base_report.benchmarks_grouped[benchmark]) return 0;
return (
(getCyclesPerUnit(benchmark) - getCyclesPerUnitMaster(benchmark)) /
getCyclesPerUnitMaster(benchmark)
);
}
function getInstructionsPerUnit(benchmark) {
if (!report.benchmarks_grouped[benchmark]) return 0;
return (
report.benchmarks_grouped[benchmark]["median(instructions)"] /
report.benchmarks_grouped[benchmark]["batch"]
);
}
function getInstructionsPerUnitMaster(benchmark) {
if (!report.base_report.benchmarks_grouped[benchmark]) return 0;
return (
report.base_report.benchmarks_grouped[benchmark][
"median(instructions)"
Expand All @@ -140,6 +155,7 @@
}
function getInstructionsPerUnitDiff(benchmark) {
if (!report.base_report.benchmarks_grouped[benchmark]) return 0;
return (
(getInstructionsPerUnit(benchmark) -
getInstructionsPerUnitMaster(benchmark)) /
Expand All @@ -148,13 +164,15 @@
}
function getBranchesPerUnit(benchmark) {
if (!report.benchmarks_grouped[benchmark]) return 0;
return (
report.benchmarks_grouped[benchmark]["median(branchinstructions)"] /
report.benchmarks_grouped[benchmark]["batch"]
);
}
function getBranchesPerUnitMaster(benchmark) {
if (!report.base_report.benchmarks_grouped[benchmark]) return 0;
return (
report.base_report.benchmarks_grouped[benchmark][
"median(branchinstructions)"
Expand Down

0 comments on commit 12ff64d

Please sign in to comment.