Created
September 26, 2017 00:40
-
-
Save ocboogie/1610e0363601ae240d8aa2449e3074e8 to your computer and use it in GitHub Desktop.
path.join benchmark
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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