diff options
author | Felix Böhm <felixboehm55@googlemail.com> | 2012-05-20 22:54:48 +0300 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2012-09-13 01:21:53 +0200 |
commit | f5c68b280fa45c9a392794364272ddfc711bc7a0 (patch) | |
tree | fa6c45670f5b04e42995868f30272b98b0f6b68d /benchmark | |
parent | bb207c2827cd758dd273adb28badeb9ec2586939 (diff) | |
download | android-node-v8-f5c68b280fa45c9a392794364272ddfc711bc7a0.tar.gz android-node-v8-f5c68b280fa45c9a392794364272ddfc711bc7a0.tar.bz2 android-node-v8-f5c68b280fa45c9a392794364272ddfc711bc7a0.zip |
bench: add url parser benchmark
Diffstat (limited to 'benchmark')
-rw-r--r-- | benchmark/url.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/benchmark/url.js b/benchmark/url.js new file mode 100644 index 0000000000..c35cd959f0 --- /dev/null +++ b/benchmark/url.js @@ -0,0 +1,22 @@ +var url = require('url'), + urls = [ + 'http://nodejs.org/docs/latest/api/url.html#url_url_format_urlobj', + 'http://blog.nodejs.org/', + 'https://encrypted.google.com/search?q=url&q=site:npmjs.org&hl=en', + 'javascript:alert("node is awesome");', + 'some.ran/dom/url.thing?oh=yes#whoo' + ], + paths = [ + '../foo/bar?baz=boom', + 'foo/bar', + 'http://nodejs.org', + './foo/bar?baz' + ]; + +urls.forEach(url.parse); +urls.forEach(url.format); +urls.forEach(function(u){ + paths.forEach(function(p){ + url.resolve(u, p); + }); +});
\ No newline at end of file |