Last active
August 29, 2015 14:06
-
-
Save dead-horse/ae3d6d34b6ec44d8d6ed to your computer and use it in GitHub Desktop.
This file contains hidden or 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
var path = require('path'); | |
var simplePath = '/home/Users/deadhorse/git/node/lib/path.js'; | |
var pathWithDot = '/home/Users/deadhorse/git/node/./lib/./path.js'; | |
var pathWithDotDot = '/home/Users/deadhorse/git/node/../lib/../path.js'; | |
var length = 1000000; | |
console.time('normalize simple path'); | |
for (var i = 0; i < length; i++) { | |
path.normalize(simplePath); | |
} | |
console.timeEnd('normalize simple path'); | |
console.time('resolve simple path'); | |
for (var i = 0; i < length; i++) { | |
path.resolve(simplePath); | |
} | |
console.timeEnd('resolve simple path'); | |
console.time('normalize path contains .'); | |
for (var i = 0; i < length; i++) { | |
path.normalize(pathWithDot); | |
} | |
console.timeEnd('normalize path contains .'); | |
console.time('resolve path contains .'); | |
for (var i = 0; i < length; i++) { | |
path.resolve(pathWithDot); | |
} | |
console.timeEnd('resolve path contains .'); | |
console.time('normalize path contains ..'); | |
for (var i = 0; i < length; i++) { | |
path.normalize(pathWithDotDot); | |
} | |
console.timeEnd('normalize path contains ..'); | |
console.time('resolve path contains ..'); | |
for (var i = 0; i < length; i++) { | |
path.resolve(pathWithDotDot); | |
} | |
console.timeEnd('resolve path contains ..'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment