mirror of
https://github.com/openstreetmap/mod_tile.git
synced 2025-08-03 07:49:53 +00:00
71 lines
1.7 KiB
HTML
71 lines
1.7 KiB
HTML
<html>
|
|
<head>
|
|
<title>Memory comparison of renderd with various malloc libraries</title>
|
|
</head>
|
|
|
|
<body>
|
|
<div>
|
|
<canvas id="myChart"></canvas>
|
|
</div>
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
|
|
|
<script src="file:rssanon-libc.js"></script>
|
|
<script src="file:rssanon-jemalloc.js"></script>
|
|
<script src="file:rssanon-mimalloc.js"></script>
|
|
<script src="file:rssanon-tcmalloc.js"></script>
|
|
|
|
<script>
|
|
/* yes, this will yield O(n^2), but I can't be bothered right now */
|
|
const rss = (time, data) => {
|
|
let rss = 0;
|
|
data.forEach((e) => {
|
|
if (e.t < time) {
|
|
rss = e.rss;
|
|
}
|
|
});
|
|
return rss;
|
|
};
|
|
const ctx = document.getElementById("myChart");
|
|
const data = libc.map((x) => ({
|
|
t: x.t,
|
|
libc_rss: x.rss,
|
|
je_rss: rss(x.t, jemalloc),
|
|
mi_rss: rss(x.t, mimalloc),
|
|
tc_rss: rss(x.t, tcmalloc),
|
|
}));
|
|
new Chart(ctx, {
|
|
type: "line",
|
|
data: {
|
|
labels: data.map((x) => x.t),
|
|
datasets: [
|
|
{
|
|
label: "libc",
|
|
data: data.map((x) => x.libc_rss),
|
|
},
|
|
{
|
|
label: "jemalloc",
|
|
data: data.map((x) => x.je_rss),
|
|
},
|
|
{
|
|
label: "mimalloc",
|
|
data: data.map((x) => x.mi_rss),
|
|
},
|
|
{
|
|
label: "tcmalloc",
|
|
data: data.map((x) => x.tc_rss),
|
|
},
|
|
],
|
|
},
|
|
options: {
|
|
scales: {
|
|
y: {
|
|
beginAtZero: true,
|
|
},
|
|
},
|
|
},
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|