JS Challenge 3

JavaScript performance comparison

Test case created and last updated

Preparation code

Benchmark.prototype.setup = function() {
    var r = 'Hello6 9World 2, Nic8e D7ay!';

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec

function NumberSearch(str){
                var letter = str.replace(/[0-9\.,-\/#!$%\^&\*;:{}=\-_`~() ]/g,"");
                var number = str.replace(/[a-zA-Z\.,-\/#!$%\^&\*;:{}=\-_`~() ]/g,"");
                var n = 0;

                for (var i=0; i< number.length; i++)
                        n = n + parseInt(number[i]);

                var result = Math.round(n / letter.length);
                return result;

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

Compare results of other browsers


Comment form temporarily disabled.

Add a comment