test-client/test-client.js
// Use benchmark.js to run a microbenchmark
Use benchmark.js to run a microbenchmark
Use benchmark . js to run a microbenchmark
function microBenchmark(test) {
    return new RSVP.Promise(function (resolve) {
      update("status-text", "Running Micro Benchmark...");
      setTimeout(function () {
        var suite = new Benchmark.Suite();
        suite.add(test.name, test.test, {
          setup: test.setup,
          distribution: test.distribution,
          teardown: test.teardown,
        });
        suite.on("cycle", function (evt) {
          test.reset();
          var r = evt.target;
          resolve({
            name: r.name,
            hz: r.hz,
            rme: r.stats.rme,
            deviation: r.stats.deviation,
            mean: r.stats.mean,
            samples: r.stats.sample.length,
            emberVersion: r.emberVersion,
            createdAt: new Date(),
          });
        });
        suite.on("error", function (evt) {
          var err = evt.target.error;
          update("status-text", "Error: " + err.message);
          throw err;
        });
        suite.run();
      }, 100);
    });
  }
function microBenchmark ( test ) { return new RSVP . Promise ( function ( resolve ) { update ( "status-text" , "Running Micro Benchmark..." ) ; setTimeout ( function ( ) { var suite = new Benchmark . Suite ( ) ; suite . add ( test . name , test . test , { setup : test . setup , distribution : test . distribution , teardown : test . teardown , } ) ; suite . on ( "cycle" , function ( evt ) { test . reset ( ) ; var r = evt . target ; resolve ( { name : r . name , hz : r . hz , rme : r . stats . rme , deviation : r . stats . deviation , mean : r . stats . mean , samples : r . stats . sample . length , emberVersion : r . emberVersion , createdAt : new Date ( ) , } ) ; } ) ; suite . on ( "error" , function ( evt ) { var err = evt . target . error ; update ( "status-text" , "Error: " + err . message ) ; throw err ; } ) ; suite . run ( ) ; } , 100 ) ; } ) ; }
Use benchmark.js to run a microbenchmark
Use benchmark . js to run a microbenchmark