Skip to content

Instantly share code, notes, and snippets.

@fghber
Last active May 27, 2018 04:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fghber/74fb64cc7822ef55c5911c9f642acae1 to your computer and use it in GitHub Desktop.
Save fghber/74fb64cc7822ef55c5911c9f642acae1 to your computer and use it in GitHub Desktop.

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