bpaton1

JavaScript performance comparison

Test case created

Preparation code

<p class="hello notranslate">Some html test</p>
 
<script>
Benchmark.prototype.setup = function() {
    var el = document.getElementsByTagName('p');
};
</script>

Preparation code output

Some html test

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
1
el[0].className.split(' ').indexOf('notranslate') !== -1;
pending…
2
new RegExp("(^|\\s)" + 'notranslate' + "(\\s|$)").test(el[0].className)
pending…

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

Compare results of other browsers

0 comments

Add a comment