Skip to content

Instantly share code, notes, and snippets.

@ocboogie
Created September 26, 2017 00:40
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 ocboogie/1610e0363601ae240d8aa2449e3074e8 to your computer and use it in GitHub Desktop.
Save ocboogie/1610e0363601ae240d8aa2449e3074e8 to your computer and use it in GitHub Desktop.
path.join benchmark
const path = require('path');
const Benchmark = require('benchmark');
const suite = new Benchmark.Suite;
suite.add('foo/bar', function() {
path.join(__dirname, 'foo/bar')
})
.add('foo, bar', function() {
path.join(__dirname, 'foo', 'bar')
})
.on('complete', function() {
console.log('Fastest is ' + this.filter('fastest').map('name'));
})
.run({ 'async': true });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment