Testing performance is surprisingly straightforward.
- Start a timer
- Run your tasks
- Stop the timer and note how much time has elapsed
- The performance.now() method
- The console.time() and console.timeEnd() methods
var start = performance.now();
// Do some JS stuff...
var end = performance.now();
console.log('This took ' + (end - start) + 'ms to complete');
console.time('My awesome performance test!');
// Do some JS stuff...
console.timeEnd('My awesome performance test!');
// This will log "My awesome performance test!: 1234.567ms" (with the actual time, of course)
Run 10,000 times, get average