joyent/node — pull request #4014 by isaacs (2012-09-13 19:09:45+00:00)
Title: Url faster

V8 loves it when JavaScript pretends to be a Classic inheritance
type of language.

Before:

$ ./node benchmark/url.js
benchmarking parse() ... 1.868 sec
benchmarking format() ... 1.906 sec
benchmarking resolve("../foo/bar?baz=boom") ... 7.800 sec
benchmarking resolve("foo/bar") ... 7.099 sec
benchmarking resolve("http://nodejs.org") ... 8.403 sec
benchmarking resolve("./foo/bar?baz") ... 7.974 sec

After:

$ ./node benchmark/url.js
benchmarking parse() ... 1.769 sec
benchmarking format() ... 1.793 sec
benchmarking resolve("../foo/bar?baz=boom") ... 4.254 sec
benchmarking resolve("foo/bar") ... 3.932 sec
benchmarking resolve("http://nodejs.org") ... 4.382 sec
benchmarking resolve("./foo/bar?baz") ... 4.293 sec