path: improve POSIX path.join() performance
authorJo Liss <joliss42@gmail.com>
Tue, 21 Jan 2014 22:24:58 +0000 (22:24 +0000)
committerTrevor Norris <trev.norris@gmail.com>
Wed, 22 Jan 2014 01:00:56 +0000 (17:00 -0800)
commitb9bec2031e5f44f47cf01c3ec466ab8cddfa94f6
treeeb7f24f989f73e377da66d24872e825cacac311f
parentcdde9a386aca90ae151be9ad9455d0d0586d113b
path: improve POSIX path.join() performance

Performance gains are ~4x (~1.5us), but still much slower than a naive
approach. There is some duplicate work done between join(), normalize()
and normalizeArray() so additional optimizations are possible.

Note that this only improves the POSIX implementation.

Thanks to @isaacs and @othiym23 for helping with this optimization.

Signed-off-by: Trevor Norris <trev.norris@gmail.com>
lib/path.js