-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Quick and dirty visualization of the memory usage
Alsok, building all the code into separate folders.. does this make a difference... no, doesn't look like it.
- Loading branch information
1 parent
6995d7b
commit 6379979
Showing
5 changed files
with
981 additions
and
913 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<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-glib.json5"></script> | ||
<script src="file:rssanon-jemalloc.json5"></script> | ||
<script src="file:rssanon-tcmalloc.json5"></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 = glib.map(x => ({ | ||
t: x.t, | ||
glib_rss: x.rss, | ||
je_rss: rss(x.t, jemalloc), | ||
tc_rss: rss(x.t, tcmalloc) | ||
})); | ||
new Chart(ctx, { | ||
type: 'line', | ||
data: { | ||
labels: data.map(x => x.t), | ||
datasets: [{ | ||
label: 'glib', | ||
data: data.map(x => x.glib_rss) | ||
}, { | ||
label: 'jemalloc', | ||
data: data.map(x => x.je_rss) | ||
}, { | ||
label: 'tcmalloc', | ||
data: data.map(x => x.tc_rss) | ||
}] | ||
}, | ||
options: { | ||
scales: { | ||
y: { | ||
beginAtZero: true | ||
} | ||
} | ||
} | ||
}); | ||
</script> | ||
|
||
</body> | ||
|
||
</html> |
Oops, something went wrong.