mirror of
https://github.com/darksaid98/mediaplex.git
synced 2026-12-01 14:38:45 +00:00
116 lines
3.2 KiB
HTML
116 lines
3.2 KiB
HTML
<!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/[email protected]/dist/chart.min.js"></script>
|
|
<title>OpusDecoder Benchmark</title>
|
|
<style>
|
|
body {
|
|
margin: 0;
|
|
padding: 0;
|
|
background: #ddd;
|
|
}
|
|
|
|
.container {
|
|
box-sizing: border-box;
|
|
height: 96vh;
|
|
width: 96vw;
|
|
margin: 2vh 2vw;
|
|
resize: both;
|
|
overflow: hidden;
|
|
padding: 20px;
|
|
background: white;
|
|
box-shadow: 0 0 15px #aaa;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="container">
|
|
<canvas id="chart1691341954933" width="16" height="9"></canvas>
|
|
</div>
|
|
<script>
|
|
const format = (num) => {
|
|
const [whole, fraction] = String(num).split('.')
|
|
const chunked = []
|
|
whole
|
|
.split('')
|
|
.reverse()
|
|
.forEach((char, index) => {
|
|
if (index % 3 === 0) {
|
|
chunked.unshift([char])
|
|
} else {
|
|
chunked[0].unshift(char)
|
|
}
|
|
})
|
|
|
|
const fractionStr = fraction !== undefined ? '.' + fraction : ''
|
|
|
|
return (
|
|
chunked.map((chunk) => chunk.join('')).join(' ') + fractionStr
|
|
)
|
|
}
|
|
const ctx1691341954933 = document
|
|
.getElementById('chart1691341954933')
|
|
.getContext('2d')
|
|
const chart1691341954933 = new Chart(ctx1691341954933, {
|
|
type: 'bar',
|
|
data: {
|
|
labels: ["mediaplex","@discordjs/opus","opusscript","opusscript (no wasm)"],
|
|
datasets: [
|
|
{
|
|
data: [11441,11821,6095,2584],
|
|
backgroundColor: ["hsl(116.14800000000001, 85%, 55%)","hsl(120, 85%, 55%)","hsl(61.87200000000001, 85%, 55%)","hsl(26.232, 85%, 55%)"],
|
|
borderColor: ["hsl(116.14800000000001, 85%, 55%)","hsl(120, 85%, 55%)","hsl(61.87200000000001, 85%, 55%)","hsl(26.232, 85%, 55%)"],
|
|
borderWidth: 2,
|
|
},
|
|
],
|
|
},
|
|
options: {
|
|
maintainAspectRatio: false,
|
|
plugins: {
|
|
title: {
|
|
display: true,
|
|
text: 'OpusDecoder Benchmark',
|
|
font: { size: 20 },
|
|
padding: 20,
|
|
},
|
|
legend: {
|
|
display: false,
|
|
},
|
|
tooltip: {
|
|
callbacks: {
|
|
label: (context) => {
|
|
return format(context.parsed.y) + ' ops/s'
|
|
},
|
|
},
|
|
displayColors: false,
|
|
backgroundColor: '#222222',
|
|
padding: 10,
|
|
cornerRadius: 5,
|
|
intersect: false,
|
|
},
|
|
},
|
|
scales: {
|
|
x: {
|
|
grid: {
|
|
color: '#888888',
|
|
},
|
|
},
|
|
y: {
|
|
title: {
|
|
display: true,
|
|
text: 'Operations per second',
|
|
padding: 10,
|
|
},
|
|
grid: {
|
|
color: '#888888',
|
|
},
|
|
},
|
|
},
|
|
},
|
|
})
|
|
</script>
|
|
</body>
|
|
</html> |