create styled div

JavaScript performance comparison

Test case created by

Test runner

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

Java applet disabled.

Testing in CCBot 2.0.0 / Other 0.0.0
Test Ops/sec
html
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;
pending…
string obj
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 = String.fromCharCode(160);

document.body.appendChild(div);
size = div.offsetHeight;
pending…
javascript
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 = '\xA0';

document.body.appendChild(div);
size = div.offsetHeight;
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.

0 Comments