jsPerf.app is an online JavaScript performance benchmark test runner & jsperf.com mirror. It is a complete rewrite in homage to the once excellent jsperf.com now with hopefully a more modern & maintainable codebase.
jsperf.com URLs are mirrored at the same path, e.g:
https://jsperf.com/negative-modulo/2
Can be accessed at:
https://jsperf.app/negative-modulo/2
<table>
<tr><td>Canvas</td><td>SVG</td></tr>
<tr><td><canvas id="canvasEl" width="441" height="441"></canvas></td><td><span id="svgWrapper"><svg id="svgEl" xmlns="http://www.w3.org/2000/svg" width="441px" height="441px" viewBox="0 0 441 441"></svg></span></td></tr>
</table>
var canvas = document.getElementById("canvasEl");
var svg = document.getElementById("svgEl");
var svgWrapper = document.getElementById("svgWrapper");
var svgNS = "http://www.w3.org/2000/svg";
var width = 20, height = 20;
var glyphRadius = 10;
var padding = 1;
var vbWidth = width*2*(glyphRadius+padding) + padding;
var vbHeight = height*2*(glyphRadius+padding) + padding;
var context = canvas.getContext("2d");
function clearChildren(parent) {
var el = parent.firstChild;
while (el) {
var next = el.nextSibling;
parent.removeChild(el);
el = next;
}
}
var coef = glyphRadius/3.62;
var glyphDef = [2.,2.361701072011516,2.7392021201364227,3.0893754959546955,
3.3722156039498232,3.555409345132316,3.6180277305584054,
3.5529169159548086,3.3675154934380602,3.083004668746773,
2.731888412081624,2.3542800384843257,1.993319457785203,
1.6902446508990239,1.4796804321972443,1.3856827338133364,
1.4189903330522349,1.5757979996057716,1.8381912245042966,
2.176192865147995,2.5511878872330405,2.9203349435576835,
3.241460788406355,3.4778783646066067,3.602578120377526,
3.6013137185190844,3.4742296107595165,3.2358445348518745,
2.913392819795754,2.5437129969500742,2.169039177999716,
1.832176014259268,1.5716084746145627,1.4171051260544505,
1.3863172204880727,1.482762125545138,1.6954214825274];
Ready to run.
Test | Ops/sec | |
---|---|---|
Canvas Many |
| ready |
Canvas Big |
| ready |
SVG Many |
| ready |
SVG Big |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.