Skip to content

Commit

Permalink
add Benchmark (pytest) benchmark result for 1cdc3ef
Browse files Browse the repository at this point in the history
  • Loading branch information
github-action-benchmark committed Jan 7, 2025
1 parent 36ea5e1 commit 2639b13
Show file tree
Hide file tree
Showing 2 changed files with 369 additions and 0 deletions.
88 changes: 88 additions & 0 deletions performance/3.13/data.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
window.BENCHMARK_DATA = {
"lastUpdate": 1736290864270,
"repoUrl": "https://github.com/konradhalas/dacite",
"entries": {
"Benchmark": [
{
"commit": {
"author": {
"email": "[email protected]",
"name": "Mateusz Ciszczoń",
"username": "mciszczon"
},
"committer": {
"email": "[email protected]",
"name": "GitHub",
"username": "web-flow"
},
"distinct": true,
"id": "1cdc3ef42fa361a368a532c02f659077c52dd41a",
"message": "Merge pull request #268 from konradhalas/chore/fix_ci",
"timestamp": "2025-01-08T00:00:11+01:00",
"tree_id": "10ab4d7d17f22ec217d3f1c5fd3e77335dc38451",
"url": "https://github.com/konradhalas/dacite/commit/1cdc3ef42fa361a368a532c02f659077c52dd41a"
},
"date": 1736290862958,
"tool": "pytest",
"benches": [
{
"name": "tests/performance/test_from_dict.py::test_basic_scenario",
"value": 18392.829903560123,
"unit": "iter/sec",
"range": "stddev: 0.000006077533626723976",
"extra": "mean: 54.3690125577924 usec\nrounds: 3424"
},
{
"name": "tests/performance/test_from_dict.py::test_union_matching",
"value": 555.766034128211,
"unit": "iter/sec",
"range": "stddev: 0.00001925341409638295",
"extra": "mean: 1.7993183076915196 msec\nrounds: 455"
},
{
"name": "tests/performance/test_from_dict.py::test_strict_unions_match",
"value": 558.155008666744,
"unit": "iter/sec",
"range": "stddev: 0.00005182823877576723",
"extra": "mean: 1.7916169961256534 msec\nrounds: 516"
},
{
"name": "tests/performance/test_from_dict.py::test_collection_of_union",
"value": 8551.177139225476,
"unit": "iter/sec",
"range": "stddev: 0.000004909980011173639",
"extra": "mean: 116.94296395906203 usec\nrounds: 3718"
},
{
"name": "tests/performance/test_from_dict.py::test_type_hooks",
"value": 552.6834994630317,
"unit": "iter/sec",
"range": "stddev: 0.000021523701479476208",
"extra": "mean: 1.8093538181826774 msec\nrounds: 517"
},
{
"name": "tests/performance/test_from_dict.py::test_casting",
"value": 184957.82267943013,
"unit": "iter/sec",
"range": "stddev: 5.927125345458689e-7",
"extra": "mean: 5.406638040572122 usec\nrounds: 12145"
},
{
"name": "tests/performance/test_from_dict.py::test_forward_references",
"value": 557.1928165479253,
"unit": "iter/sec",
"range": "stddev: 0.000017785743092998528",
"extra": "mean: 1.7947108618439767 msec\nrounds: 456"
},
{
"name": "tests/performance/test_from_dict.py::test_parsing_multiple_items",
"value": 22.431412980098045,
"unit": "iter/sec",
"range": "stddev: 0.0010932132873760958",
"extra": "mean: 44.580339227280774 msec\nrounds: 22"
}
]
}
]
}
}
281 changes: 281 additions & 0 deletions performance/3.13/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,281 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes" />
<style>
html {
font-family: BlinkMacSystemFont,-apple-system,"Segoe UI",Roboto,Oxygen,Ubuntu,Cantarell,"Fira Sans","Droid Sans","Helvetica Neue",Helvetica,Arial,sans-serif;
-webkit-font-smoothing: antialiased;
background-color: #fff;
font-size: 16px;
}
body {
color: #4a4a4a;
margin: 8px;
font-size: 1em;
font-weight: 400;
}
header {
margin-bottom: 8px;
display: flex;
flex-direction: column;
}
main {
width: 100%;
display: flex;
flex-direction: column;
}
a {
color: #3273dc;
cursor: pointer;
text-decoration: none;
}
a:hover {
color: #000;
}
button {
color: #fff;
background-color: #3298dc;
border-color: transparent;
cursor: pointer;
text-align: center;
}
button:hover {
background-color: #2793da;
flex: none;
}
.spacer {
flex: auto;
}
.small {
font-size: 0.75rem;
}
footer {
margin-top: 16px;
display: flex;
align-items: center;
}
.header-label {
margin-right: 4px;
}
.benchmark-set {
margin: 8px 0;
width: 100%;
display: flex;
flex-direction: column;
}
.benchmark-title {
font-size: 3rem;
font-weight: 600;
word-break: break-word;
text-align: center;
}
.benchmark-graphs {
display: flex;
flex-direction: row;
justify-content: space-around;
align-items: center;
flex-wrap: wrap;
width: 100%;
}
.benchmark-chart {
max-width: 1000px;
}
</style>
<title>Benchmarks</title>
</head>

<body>
<header id="header">
<div class="header-item">
<strong class="header-label">Last Update:</strong>
<span id="last-update"></span>
</div>
<div class="header-item">
<strong class="header-label">Repository:</strong>
<a id="repository-link" rel="noopener"></a>
</div>
</header>
<main id="main"></main>
<footer>
<button id="dl-button">Download data as JSON</button>
<div class="spacer"></div>
<div class="small">Powered by <a rel="noopener" href="https://github.com/marketplace/actions/continuous-benchmark">github-action-benchmark</a></div>
</footer>

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/Chart.min.js"></script>
<script src="data.js"></script>
<script id="main-script">
'use strict';
(function() {
// Colors from https://github.com/github/linguist/blob/master/lib/linguist/languages.yml
const toolColors = {
cargo: '#dea584',
go: '#00add8',
benchmarkjs: '#f1e05a',
benchmarkluau: '#000080',
pytest: '#3572a5',
googlecpp: '#f34b7d',
catch2: '#f34b7d',
julia: '#a270ba',
jmh: '#b07219',
benchmarkdotnet: '#178600',
customBiggerIsBetter: '#38ff38',
customSmallerIsBetter: '#ff3838',
_: '#333333'
};

function init() {
function collectBenchesPerTestCase(entries) {
const map = new Map();
for (const entry of entries) {
const {commit, date, tool, benches} = entry;
for (const bench of benches) {
const result = { commit, date, tool, bench };
const arr = map.get(bench.name);
if (arr === undefined) {
map.set(bench.name, [result]);
} else {
arr.push(result);
}
}
}
return map;
}

const data = window.BENCHMARK_DATA;

// Render header
document.getElementById('last-update').textContent = new Date(data.lastUpdate).toString();
const repoLink = document.getElementById('repository-link');
repoLink.href = data.repoUrl;
repoLink.textContent = data.repoUrl;

// Render footer
document.getElementById('dl-button').onclick = () => {
const dataUrl = 'data:,' + JSON.stringify(data, null, 2);
const a = document.createElement('a');
a.href = dataUrl;
a.download = 'benchmark_data.json';
a.click();
};

// Prepare data points for charts
return Object.keys(data.entries).map(name => ({
name,
dataSet: collectBenchesPerTestCase(data.entries[name]),
}));
}

function renderAllChars(dataSets) {

function renderGraph(parent, name, dataset) {
const canvas = document.createElement('canvas');
canvas.className = 'benchmark-chart';
parent.appendChild(canvas);

const color = toolColors[dataset.length > 0 ? dataset[0].tool : '_'];
const data = {
labels: dataset.map(d => d.commit.id.slice(0, 7)),
datasets: [
{
label: name,
data: dataset.map(d => d.bench.value),
borderColor: color,
backgroundColor: color + '60', // Add alpha for #rrggbbaa
}
],
};
const options = {
scales: {
xAxes: [
{
scaleLabel: {
display: true,
labelString: 'commit',
},
}
],
yAxes: [
{
scaleLabel: {
display: true,
labelString: dataset.length > 0 ? dataset[0].bench.unit : '',
},
ticks: {
beginAtZero: true,
}
}
],
},
tooltips: {
callbacks: {
afterTitle: items => {
const {index} = items[0];
const data = dataset[index];
return '\n' + data.commit.message + '\n\n' + data.commit.timestamp + ' committed by @' + data.commit.committer.username + '\n';
},
label: item => {
let label = item.value;
const { range, unit } = dataset[item.index].bench;
label += ' ' + unit;
if (range) {
label += ' (' + range + ')';
}
return label;
},
afterLabel: item => {
const { extra } = dataset[item.index].bench;
return extra ? '\n' + extra : '';
}
}
},
onClick: (_mouseEvent, activeElems) => {
if (activeElems.length === 0) {
return;
}
// XXX: Undocumented. How can we know the index?
const index = activeElems[0]._index;
const url = dataset[index].commit.url;
window.open(url, '_blank');
},
};

new Chart(canvas, {
type: 'line',
data,
options,
});
}

function renderBenchSet(name, benchSet, main) {
const setElem = document.createElement('div');
setElem.className = 'benchmark-set';
main.appendChild(setElem);

const nameElem = document.createElement('h1');
nameElem.className = 'benchmark-title';
nameElem.textContent = name;
setElem.appendChild(nameElem);

const graphsElem = document.createElement('div');
graphsElem.className = 'benchmark-graphs';
setElem.appendChild(graphsElem);

for (const [benchName, benches] of benchSet.entries()) {
renderGraph(graphsElem, benchName, benches)
}
}

const main = document.getElementById('main');
for (const {name, dataSet} of dataSets) {
renderBenchSet(name, dataSet, main);
}
}

renderAllChars(init()); // Start
})();
</script>
</body>
</html>

0 comments on commit 2639b13

Please sign in to comment.