Conversation
posix.resolve always runs normalizeString, even when the merged path has no '.' / '..' segments and no empty '//'. Skip that pass and drop the trailing slash the join added. Official benchmark/path/relative-posix.js is about 52% faster for /data/orandea/test/aaa vs /data/orandea/impl/bbb, about 37% faster for /foo/bar/baz/quux vs /var/log, and about 25% faster for /foo/bar/baz/quux vs /. Paths that still need normalizeString are within noise except a short double-slash join. Assisted-by: a closed-source coding agent Signed-off-by: Yagiz Nizipli <yagiz@nizipli.com> Co-authored-by: Yagiz Nizipli <anonrig@users.noreply.github.com>
cursor
Bot
force-pushed
the
cursor/path-simple-fast-ead2
branch
from
September 22, 2026 06:32
81011ae to
62291aa
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
posix.resolve always runs normalizeString, even when the merged path has no
./..segments and no empty//segments. Skip that pass and drop the trailing slash the join added. Whenprocess.cwd()fails, the relative path still goes through normalizeString sopath.resolve()stays..Official
benchmark/path/relative-posix.js(--no-node-snapshot, 5 alternating runs vs parent):/data/orandea/test/aaavs/data/orandea/impl/bbb/foo/bar/baz/quuxvs/var/log/foo/bar/baz/quuxvs//foo/bar/baz/quuxvs itself/vs//varvs/bin/vs/vartest/parallel/test-path-resolve.js,test-path-relative.js,test-path-join.js,test-path-normalize.js, andtest-path.jspass. A closed-source coding agent assisted with the implementation.