SvgPath_CreateVsClone

Benchmark created by Allen Xiong on


Preparation HTML

<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
</svg>

Test runner

Ready to run.

Testing in
TestOps/sec
create
var svg = document.getElementsByTagName('svg')[0];

var path = document.createElementNS("http://www.w3.org/2000/svg", "path");
path.setAttribute("d", "M150 0 L75 200 L225 200 Z");
svg.appendChild(path);

path = document.createElementNS("http://www.w3.org/2000/svg", "path");
path.setAttribute("d", "M150 0 L75 200 L225 200 Z");
svg.appendChild(path);
ready
clone
var svg = document.getElementsByTagName('svg')[0];

var path = document.createElementNS("http://www.w3.org/2000/svg", "path");
path.setAttribute("d", "M150 0 L75 200 L225 200 Z");
svg.appendChild(path);

var shadowPath = path.cloneNode(false);
svg.appendChild(shadowPath);
ready

Revisions

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

  • Revision 1: published by Allen Xiong on