diff --git a/404.html b/404.html index 63d35e1..a0a175f 100644 --- a/404.html +++ b/404.html @@ -160,7 +160,7 @@

Not Found

- + + + + + + + + + + + +
+
+
Chipmunk Logo
+ + +
+
+ + + + + + + Performance Benchmarks + + + + +
+

Chipmunk Performance Changes

+

< +

+

+

+
+ + + + + + + diff --git a/benchmarks/js/script.js b/benchmarks/js/script.js new file mode 100644 index 0000000..49f87d2 --- /dev/null +++ b/benchmarks/js/script.js @@ -0,0 +1,68 @@ +document.addEventListener('DOMContentLoaded', function () { + // Load benchmark data from JSON + fetch('data/data.json') + .then(response => response.json()) + .then(data => { + // Extract all unique file names + const allFileNames = []; + Object.keys(data).forEach(benchmark => { + data[benchmark].forEach(entry => { + if (!allFileNames.includes(entry.release)) { + allFileNames.push(entry.release); + } + }); + }); + + // Prepare labels and datasets for Chart.js + const datasets = Object.keys(data).map(benchmark => ({ + label: benchmark, + data: data[benchmark].map(entry => entry.actual_value), + fill: false, + borderColor: getRandomColor(), + tension: 0.1 + })); + + // Render chart using Chart.js + const ctx = document.getElementById('benchmarkChart').getContext('2d'); + new Chart(ctx, { + type: 'line', + data: { + labels: allFileNames, + datasets: datasets + }, + options: { + responsive: true, + plugins: { + tooltip: { + mode: 'index', + intersect: false + } + }, + scales: { + x: { + title: { + display: true, + text: 'Release' + } + }, + y: { + title: { + display: true, + text: 'Actual Value (ms)' + } + } + } + } + }); + }) + .catch(error => console.error('Error fetching data:', error)); + + function getRandomColor() { + const letters = '0123456789ABCDEF'; + let color = '#'; + for (let i = 0; i < 6; i++) { + color += letters[Math.floor(Math.random() * 16)]; + } + return color; + } +}); diff --git a/benchmarks/js/script1.js b/benchmarks/js/script1.js new file mode 100644 index 0000000..5d38407 --- /dev/null +++ b/benchmarks/js/script1.js @@ -0,0 +1,112 @@ +document.addEventListener('DOMContentLoaded', function () { + // Load benchmark data from JSON + fetch('data/data.json') + .then(response => response.json()) + .then(data => { + // Prepare data for the two categories + const below500Data = {}; + const above500Data = {}; + + const allFileNames = []; + + Object.keys(data).forEach(benchmark => { + data[benchmark].forEach(entry => { + if (!allFileNames.includes(entry.release)) { + allFileNames.push(entry.release); + } + }); + + const values = data[benchmark].map(entry => entry.actual_value); + const maxValue = Math.max(...values); + if (maxValue < 500) { + below500Data[benchmark] = data[benchmark]; + } else { + above500Data[benchmark] = data[benchmark]; + } + }); + + function createDatasets(data) { + return Object.keys(data).map(benchmark => ({ + label: benchmark, + data: data[benchmark].map(entry => entry.actual_value), + fill: false, + borderColor: getRandomColor(), + tension: 0.1 + })); + } + + // Create datasets for both categories + const below500Datasets = createDatasets(below500Data); + const above500Datasets = createDatasets(above500Data); + + // Render chart for benchmarks with max value below 500 ms + const ctxBelow500 = document.getElementById('chartSegment1').getContext('2d'); + new Chart(ctxBelow500, { + type: 'line', + data: { + labels: allFileNames, + datasets: below500Datasets + }, + options: { + responsive: true, + plugins: { + tooltip: { + mode: 'index', + intersect: false + }, + legend: { + position: 'chartArea' + } + }, + scales: { + y: { + title: { + display: true, + text: 'Actual Value (ms)' + } + } + } + } + }); + + // Render chart for benchmarks with min value above 500 ms + const ctxAbove500 = document.getElementById('chartSegment2').getContext('2d'); + new Chart(ctxAbove500, { + type: 'line', + data: { + labels: allFileNames, + datasets: above500Datasets + }, + options: { + responsive: true, + plugins: { + tooltip: { + mode: 'index', + intersect: false + }, + legend: { + position: 'chartArea' + } + }, + scales: { + y: { + title: { + display: true, + text: 'Actual Value (ms)' + } + } + } + } + }); + }) + .catch(error => console.error('Error fetching data:', error)); + + function getRandomColor() { + const letters = '0123456789ABCDEF'; + let color = '#'; + for (let i = 0; i < 6; i++) { + color += letters[Math.floor(Math.random() * 16)]; + } + return color; + } +}); diff --git a/blog/index.html b/blog/index.html index a0ed30d..76a8a1b 100644 --- a/blog/index.html +++ b/blog/index.html @@ -217,7 +217,7 @@

© 2021 ESR Labs AG

+ - - + + - + + +
- -