Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?

Interesting Reads:

Date/Time

https://date-fns.org/
https://momentjs.com/

Text

The string iteratoriterates over code points not prapheme clusters

Testing

Performance Benchmarking

  • jsPerf — JavaScript performance playground
  • benchmark.js - A benchmarking library that supports high-resolution timers & returns statistically significant results.
var Benchmark = require('benchmark');
var suite = new Benchmark.Suite;

// add tests
suite.add('RegExp#test', function() {
    ...
})
.add('String#indexOf', function() {
    ...
})
// add listeners
.on('cycle', function(event) {
  console.log(String(event.target));
})
.on('complete', function() {
  console.log('Fastest is ' + this.filter('fastest').map('name'));
})
// run async
.run({ 'async': true });

Resources

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.