create styled div

JavaScript performance comparison

Revision 2 of this test case created

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
*
var size, font = "bold 16pt 'Arial'", div = document.createElement('DIV');
   
div.style.position = 'absolute';
div.style.top = '-100px';
div.style.left = '-100px';
div.style.font = font;
div.innerHTML = '*';

document.body.appendChild(div);
size = div.offsetHeight;
document.body.removeChild(div);
pending…
_
var size, font = "bold 16pt 'Arial'", div = document.createElement('DIV');
   
div.style.position = 'absolute';
div.style.top = '-100px';
div.style.left = '-100px';
div.style.font = font;
div.innerHTML = '_';

document.body.appendChild(div);
size = div.offsetHeight;
document.body.removeChild(div);
pending…
.
var size, font = "bold 16pt 'Arial'", div = document.createElement('DIV');
   
div.style.position = 'absolute';
div.style.top = '-100px';
div.style.left = '-100px';
div.style.font = font;
div.innerHTML = '.';

document.body.appendChild(div);
size = div.offsetHeight;
document.body.removeChild(div);
pending…
/
var size, font = "bold 16pt 'Arial'", div = document.createElement('DIV');
   
div.style.position = 'absolute';
div.style.top = '-100px';
div.style.left = '-100px';
div.style.font = font;
div.innerHTML = '/';

document.body.appendChild(div);
size = div.offsetHeight;
document.body.removeChild(div);
pending…
-
var size, font = "bold 16pt 'Arial'", div = document.createElement('DIV');
   
div.style.position = 'absolute';
div.style.top = '-100px';
div.style.left = '-100px';
div.style.font = font;
div.innerHTML = '-';

document.body.appendChild(div);
size = div.offsetHeight;
document.body.removeChild(div);
pending…
A
var size, font = "bold 16pt 'Arial'", div = document.createElement('DIV');
   
div.style.position = 'absolute';
div.style.top = '-100px';
div.style.left = '-100px';
div.style.font = font;
div.innerHTML = 'A';

document.body.appendChild(div);
size = div.offsetHeight;
document.body.removeChild(div);
pending…

Compare results of other browsers

Revisions

You can edit these tests or add even more tests to this page by appending /edit to the URL. Here’s a list of current revisions for this page:

0 comments

Add a comment