Skip to content

Commit 729ad75

Browse files
mscdexrvagg
authored andcommitted
url: improve url.parse() performance
This commit improves url.parse() performance by 50-210% with the existing url/url-parse benchmarks. Also, the optimizations made in url.format() result in a 40% increase in performance for url.resolve(). Some optimization strategies used in this commit include: * Combining multiple searches on the same string into a single loop * Avoiding unnecessary string.split() and array.join() * Minimizing creation of temporary strings * Using a faster alternative to encodeURIComponent, borrowed from the querystring module PR-URL: #4892 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ryan Graham <[email protected]> Reviewed-By: Johan Bergström <[email protected]>
1 parent df93d60 commit 729ad75

File tree

1 file changed

+414
-153
lines changed

1 file changed

+414
-153
lines changed

0 commit comments

Comments
 (0)