This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

url: Go much faster by using Url class

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
  • Loading branch information...
isaacs committed Sep 13, 2012
1 parent 3806cf0 commit 7144be70db2e6ce337d0f6ec47a28a06802d1c7a
Showing with 231 additions and 180 deletions.
  1. +220 −161 lib/url.js
  2. +11 −19 test/simple/test-url.js
Oops, something went wrong.

0 comments on commit 7144be7

Please sign in to comment.