AdamHasADog

Benchmark created by PAEz on


Setup

(function(root) {
    '_Adam,_has,_a,_dog,_The,_name,_of,_the,_is,_also'.split(',').forEach(function(w) {
      root[w] = function(input) {
          return w + (input ? ' '+input : '.');
        };
    });
    })(window);
    
    var funcs = "$Adam $has $a $dog $The $name $of $the $is $also".split(" ");
    func = function(word, sentence) {
        return sentence === undefined ? word + '.' : word + " " + sentence;
    };
    funcs.forEach(function(word) {
        window[word] = func.bind(window, word)
    });

Test runner

Ready to run.

Testing in
TestOps/sec
1
$The($name($of($the($dog($is($also($Adam())))))));
ready
2
_The(_name(_of(_the(_dog(_is(_also(_Adam())))))));
ready

Revisions

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

  • Revision 1: published by PAEz on