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
This is to test if there is any overhead of using SVG or VML for rendering shapes that can otherwise be rendered using HTML.
<div id="svgcontainer" style="height:300px; width: 900px; overflow: hidden; position:relative;">
</div>
<div id="htmlcontainer" style="height:300px; width: 900px; overflow: hidden; position:relative;">
</div>
<script type="text/javascript" src="http://yui.yahooapis.com/combo?3.4.1/build/yui/yui.js">
</script>
<script type="text/javascript" src="http://tinternet.ath.cx/yui/graphics-html.js">
</script>
<script type="text/javascript" src="http://tinternet.ath.cx/yui/graphics-vml.js">
</script>
<script type="text/javascript">
YUI({
combine: true,
filter: "raw"
}).use("base", "node", "charts", "graphics-html", function(Y) {
var width = 5,
height = 10,
xpos = 0,
ypos = 0,
svgGraphic, htmlGraphic;
window.SVGTestCase = function() {
svgGraphic.addShape({
type: "rect",
x: xpos,
y: ypos,
width: width,
height: height,
fill: {
color: "#9aa"
},
stroke: {
color: "#366",
weight: 1
}
});
NextPos();
};
window.ResetTest = function() {
xpos = ypos = 0;
if (svgGraphic) {
svgGraphic.destroy();
}
if (htmlGraphic) {
htmlGraphic.destroy();
}
svgGraphic = new Y.Graphic({
render: "#svgcontainer",
height: 100,
width: 200
});
htmlGraphic = new Y.HTMLGraphic({
render: "#htmlcontainer",
height: 100,
width: 200
});
};
window.NextPos = function() {
var curr = xpos;
xpos += width + 5;
if (xpos > 890) {
xpos = 0;
ypos += height + 5;
}
return curr;
};
window.HTMLTestCase = function() {
htmlGraphic.addShape({
type: "rect",
x: xpos,
y: ypos,
width: width,
height: height,
fill: {
color: "#9aa"
},
stroke: {
color: "#366",
weight: 1
}
});
NextPos();
};
ResetTest();
SVGTestCase();
ResetTest();
HTMLTestCase();
});
</script>
ResetTest();
Ready to run.
Test | Ops/sec | |
---|---|---|
SVG/VML |
| ready |
HTML |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.