lib: micro-optimize url.resolve()
authorBen Noordhuis <info@bnoordhuis.nl>
Fri, 19 Dec 2014 22:46:37 +0000 (23:46 +0100)
committerBen Noordhuis <info@bnoordhuis.nl>
Sat, 20 Dec 2014 20:33:52 +0000 (21:33 +0100)
commitaff56cd2b4fb26157ee55cc9377d5186e5625f32
treed677cfb3ef41279bd0bea03ac49c5c6ca2496c9d
parent6b2af5f0c7056fc8ab35633b45d6346ab2fdc4f5
lib: micro-optimize url.resolve()

Replace the call to Array#splice() with a faster open-coded version
that creates less garbage.

Add a new benchmark to prove it.  With the change applied, it scores
about 5% higher and that is nothing to sneeze at.

PR-URL: https://github.com/iojs/io.js/pull/184
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
benchmark/url/url-resolve.js [new file with mode: 0644]
lib/url.js