Liron

JavaScript performance comparison

Test case created by Liron Goldenberg

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
test1
                        var input = "1234abcd",
                          upper = 0,
                          result = input.charAt(0).toLowerCase() === input.charAt(0);

                        for (var i = 1; i < input.length; i++) {
                          if (input.charAt(i).toUpperCase() === input.charAt(i)) {
                            upper++;
                          }
                        }

                        result && upper === 1;
pending…
test2
                        var input = "1234abcd",
                          upper = input.replace(/[^a-z]/g, '').length,
                          result = input.charAt(0).toLowerCase() === input.charAt(0);

                        result && upper === 1;
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