-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Expand file tree
/
Copy pathclustering_benchmark_dashboard.html
More file actions
95 lines (85 loc) · 4.51 KB
/
clustering_benchmark_dashboard.html
File metadata and controls
95 lines (85 loc) · 4.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Clustering Benchmark Dashboard</title>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<style>
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; margin: 0; padding: 20px; background-color: #f6f8fa; color: #24292f; }
.container { max-width: 1200px; margin: 0 auto; background: white; padding: 30px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.12); }
h1, h2 { text-align: center; color: #0969da; }
.charts { display: flex; flex-wrap: wrap; gap: 20px; justify-content: center; margin-top: 30px; }
.chart-container { flex: 1 1 45%; min-width: 400px; padding: 15px; border: 1px solid #d0d7de; border-radius: 6px; }
canvas { width: 100% !important; height: 300px !important; }
.footer { text-align: center; margin-top: 40px; font-size: 0.9em; color: #57606a; }
</style>
</head>
<body>
<div class="container">
<h1>Android Maps Utils Clustering Benchmarks</h1>
<p style="text-align: center;">Performance comparison between the original Java implementation (<code>main</code>) and the Kotlin rewrite (<code>feat/rewrite-android-maps-utils</code>).</p>
<div class="charts">
<!-- GridBasedAlgorithm Chart -->
<div class="chart-container">
<h2>GridBasedAlgorithm</h2>
<canvas id="gridChart"></canvas>
</div>
<!-- NonHierarchicalDistanceBasedAlgorithm Chart -->
<div class="chart-container">
<h2>NonHierarchicalDistanceBasedAlgorithm</h2>
<canvas id="distanceChart"></canvas>
</div>
<!-- CentroidNonHierarchicalDistanceBasedAlgorithm Chart -->
<div class="chart-container">
<h2>CentroidNonHierarchicalDistanceBased</h2>
<canvas id="centroidChart"></canvas>
</div>
<!-- ContinuousZoomEuclideanCentroidAlgorithm Chart -->
<div class="chart-container">
<h2>ContinuousZoomEuclideanCentroid</h2>
<canvas id="continuousChart"></canvas>
</div>
<!-- PreCachingAlgorithmDecorator Chart -->
<div class="chart-container">
<h2>PreCachingAlgorithmDecorator</h2>
<canvas id="preCachingChart"></canvas>
</div>
</div>
<div class="footer">
Note: Measurements are in milliseconds (ms) averaged across 10 iterations. Lower is better. Tests conducted with 50,000 random items.
</div>
</div>
<script>
const chartOptions = {
responsive: true,
maintainAspectRatio: false,
scales: { y: { beginAtZero: true, title: { display: true, text: 'Time (ms)' } } },
plugins: { legend: { position: 'top' } }
};
const labels = ['addItems', 'zoom 4.0', 'zoom 8.0', 'zoom 12.0', 'zoom 16.0'];
const colors = {
java: { bg: 'rgba(255, 99, 132, 0.7)', border: 'rgb(255, 99, 132)' },
kotlin: { bg: 'rgba(54, 162, 235, 0.7)', border: 'rgb(54, 162, 235)' }
};
function createChart(ctxId, dataJava, dataKotlin) {
new Chart(document.getElementById(ctxId).getContext('2d'), {
type: 'bar',
data: {
labels: labels,
datasets: [
{ label: 'Java (main)', data: dataJava, backgroundColor: colors.java.bg, borderColor: colors.java.border, borderWidth: 1 },
{ label: 'Kotlin (rewrite)', data: dataKotlin, backgroundColor: colors.kotlin.bg, borderColor: colors.kotlin.border, borderWidth: 1 }
]
},
options: chartOptions
});
}
createChart('gridChart', [6.28, 29.93, 206.30, 269.87, 228.93], [6.37, 29.77, 189.84, 250.74, 221.97]);
createChart('distanceChart', [22.60, 50.19, 70.89, 63.84, 62.89], [20.62, 48.33, 62.50, 55.42, 53.83]);
createChart('centroidChart', [32.28, 81.76, 133.18, 82.79, 90.66], [43.37, 77.41, 128.38, 105.66, 72.02]);
createChart('continuousChart', [21.99, 82.72, 105.88, 92.08, 100.84], [20.78, 76.80, 96.01, 89.77, 87.47]);
createChart('preCachingChart', [48.36, 84.21, 74.76, 75.32, 62.51], [47.58, 118.35, 72.57, 66.87, 69.80]);
</script>
</body>
</html>