Skip to content

Commit

Permalink
underway
Browse files Browse the repository at this point in the history
  • Loading branch information
StoneCypher committed Mar 4, 2021
1 parent 5a4f8b7 commit fbe88ef
Show file tree
Hide file tree
Showing 6 changed files with 969 additions and 557 deletions.
2 changes: 2 additions & 0 deletions .npmignore
Expand Up @@ -56,3 +56,5 @@ dist/jssm.es5.iife.js
dist/jssm.es5.iife.nonmin.js
dist/jssm.es5.cjs.nonmin.js
dist/es6/jssm-dot.nonmin.js

benchmark/
102 changes: 102 additions & 0 deletions benchmark/results/reduce.chart.html
@@ -0,0 +1,102 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" />
<script src="https://cdn.jsdelivr.net/npm/chart.js@2.8.0/dist/Chart.min.js"></script>
<style>
.wrapper {
display: flex;
flex: wrap;
order: row;
}
</style>
<title>Example</title>
</head>
<body>
<div style="max-width: 800px">
<canvas id="chart1613239320153" width="16" height="9"></canvas>
</div>
<script>
const format = (num) => {
const chunked = [];
String(num)
.split("")
.reverse()
.forEach((char, index) => {
if (index % 3 === 0) {
chunked.unshift([char]);
} else {
chunked[0].unshift(char);
}
});

return chunked.map((chunk) => chunk.join("")).join(" ");
};
const ctx1613239320153 = document
.getElementById("chart1613239320153")
.getContext("2d");
const chart1613239320153 = new Chart(ctx1613239320153, {
type: "bar",
data: {
labels: ["Reduce two elements", "Reduce five elements"],
datasets: [
{
data: [214117916, 192837271],
backgroundColor: [
"rgba(63, 142, 252, 0.8)",
"rgba(116, 165, 127, 0.8)",
],
borderColor: ["rgba(63, 142, 252, 1)", "rgba(116, 165, 127, 1)"],
borderWidth: 1,
},
],
},
options: {
legend: {
display: false,
},
title: {
display: true,
text: "Example",
fontSize: 16,
padding: 20,
},
tooltips: {
callbacks: {
label: (tooltipItem) => {
return format(tooltipItem.yLabel) + " ops/s";
},
},
},
scales: {
yAxes: [
{
gridLines: {
color: "rgba(127, 127, 127, 0.2)",
},
scaleLabel: {
display: true,
labelString: "Operations per second",
},
ticks: {
beginAtZero: true,
callback: format,
},
},
],
xAxes: [
{
gridLines: {
color: "rgba(127, 127, 127, 0.2)",
},
maxBarThickness: 150,
},
],
},
},
});
</script>
</body>
</html>
27 changes: 27 additions & 0 deletions benchmark/results/reduce.json
@@ -0,0 +1,27 @@
{
"name": "Example",
"date": "2021-02-13T18:02:00.153Z",
"version": "1.0.0",
"results": [
{
"name": "Reduce two elements",
"ops": 214117916,
"margin": 0.29,
"percentSlower": 0
},
{
"name": "Reduce five elements",
"ops": 192837271,
"margin": 0.78,
"percentSlower": 9.94
}
],
"fastest": {
"name": "Reduce two elements",
"index": 0
},
"slowest": {
"name": "Reduce five elements",
"index": 1
}
}

0 comments on commit fbe88ef

Please sign in to comment.