html vs svg vs canvas (v24)

Revision 24 of this benchmark created on


Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>

Setup

var canvas = document.createElement('canvas');
    var svg = document.createElementNS("http:/ / www.w3.org / 2000 / svg ", 'svg');
    var container = document.createElement('div');
    var motherDiv = document.createElement('div');

Teardown


    container.innerHTML = '';
  

Test runner

Ready to run.

Testing in
TestOps/sec
canvas
var paper = canvas.getContext('2d');
paper.fillRect(10, 10, 500, 500);
ready
svg
var rect = document.createElementNS("http://www.w3.org/2000/svg", 'rect');
rect.setAttribute("x", 10);
rect.setAttribute("y", 10);
rect.setAttribute("width", 500);
rect.setAttribute("height", 500);
svg.appendChild(rect);
ready
div
var div = motherDiv.cloneNode();
div.style.position = "absolute";
div.style.top = "10px";
div.style.left = "10px";
div.style.width = "500px";
div.style.height = "500px";
container.appendChild(div);
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.