summaryrefslogtreecommitdiff
path: root/benchmark/url
diff options
context:
space:
mode:
authorJoyee Cheung <joyeec9h3@gmail.com>2017-02-09 23:41:14 +0800
committerJames M Snell <jasnell@gmail.com>2017-02-15 09:12:16 -0800
commite571fd4f6ccadd9e77095ca0377a9b07f49bc56b (patch)
treeb3804960362475be981515baf4521cc1c97d4707 /benchmark/url
parent036eef10034ba63595e730d902eb3ce1f0b17585 (diff)
downloadandroid-node-v8-e571fd4f6ccadd9e77095ca0377a9b07f49bc56b.tar.gz
android-node-v8-e571fd4f6ccadd9e77095ca0377a9b07f49bc56b.tar.bz2
android-node-v8-e571fd4f6ccadd9e77095ca0377a9b07f49bc56b.zip
benchmark: move url data to fixtures
PR-URL: https://github.com/nodejs/node/pull/11264 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Brian White <mscdex@mscdex.net>
Diffstat (limited to 'benchmark/url')
-rw-r--r--benchmark/url/legacy-vs-whatwg-url-get-prop.js14
-rw-r--r--benchmark/url/legacy-vs-whatwg-url-parse.js14
-rw-r--r--benchmark/url/legacy-vs-whatwg-url-searchparams-parse.js13
-rw-r--r--benchmark/url/legacy-vs-whatwg-url-searchparams-serialize.js13
-rw-r--r--benchmark/url/legacy-vs-whatwg-url-serialize.js14
5 files changed, 5 insertions, 63 deletions
diff --git a/benchmark/url/legacy-vs-whatwg-url-get-prop.js b/benchmark/url/legacy-vs-whatwg-url-get-prop.js
index f703b75b16..ffc8b4995d 100644
--- a/benchmark/url/legacy-vs-whatwg-url-get-prop.js
+++ b/benchmark/url/legacy-vs-whatwg-url-get-prop.js
@@ -3,19 +3,7 @@ const common = require('../common.js');
const url = require('url');
const URL = url.URL;
const assert = require('assert');
-
-const inputs = {
- long: 'http://nodejs.org:89/docs/latest/api/url.html#test?' +
- 'payload1=true&payload2=false&test=1&benchmark=3&' +
- 'foo=38.38.011.293&bar=1234834910480&test=19299&3992&' +
- 'key=f5c65e1e98fe07e648249ad41e1cfdb0',
- short: 'https://nodejs.org/en/blog/',
- idn: 'http://你好你好',
- auth: 'https://user:pass@example.com/path?search=1',
- special: 'file:///foo/bar/test/node.js',
- percent: 'https://%E4%BD%A0/foo',
- dot: 'https://example.org/./a/../b/./c'
-};
+const inputs = require('../fixtures/url-inputs.js').urls;
const bench = common.createBenchmark(main, {
type: Object.keys(inputs),
diff --git a/benchmark/url/legacy-vs-whatwg-url-parse.js b/benchmark/url/legacy-vs-whatwg-url-parse.js
index 64533e67e4..ec386b7b85 100644
--- a/benchmark/url/legacy-vs-whatwg-url-parse.js
+++ b/benchmark/url/legacy-vs-whatwg-url-parse.js
@@ -3,19 +3,7 @@ const common = require('../common.js');
const url = require('url');
const URL = url.URL;
const assert = require('assert');
-
-const inputs = {
- long: 'http://nodejs.org:89/docs/latest/api/url.html#test?' +
- 'payload1=true&payload2=false&test=1&benchmark=3&' +
- 'foo=38.38.011.293&bar=1234834910480&test=19299&3992&' +
- 'key=f5c65e1e98fe07e648249ad41e1cfdb0',
- short: 'https://nodejs.org/en/blog/',
- idn: 'http://你好你好',
- auth: 'https://user:pass@example.com/path?search=1',
- special: 'file:///foo/bar/test/node.js',
- percent: 'https://%E4%BD%A0/foo',
- dot: 'https://example.org/./a/../b/./c'
-};
+const inputs = require('../fixtures/url-inputs.js').urls;
const bench = common.createBenchmark(main, {
type: Object.keys(inputs),
diff --git a/benchmark/url/legacy-vs-whatwg-url-searchparams-parse.js b/benchmark/url/legacy-vs-whatwg-url-searchparams-parse.js
index e76f2dd837..86714df6c1 100644
--- a/benchmark/url/legacy-vs-whatwg-url-searchparams-parse.js
+++ b/benchmark/url/legacy-vs-whatwg-url-searchparams-parse.js
@@ -2,18 +2,7 @@
const common = require('../common.js');
const { URLSearchParams } = require('url');
const querystring = require('querystring');
-
-const inputs = {
- noencode: 'foo=bar&baz=quux&xyzzy=thud',
- encodemany: '%66%6F%6F=bar&%62%61%7A=quux&xyzzy=%74h%75d',
- encodefake: 'foo=%©ar&baz=%A©uux&xyzzy=%©ud',
- encodelast: 'foo=bar&baz=quux&xyzzy=thu%64',
- multicharsep: 'foo=bar&&&&&&&&&&baz=quux&&&&&&&&&&xyzzy=thud',
- multivalue: 'foo=bar&foo=baz&foo=quux&quuy=quuz',
- multivaluemany: 'foo=bar&foo=baz&foo=quux&quuy=quuz&foo=abc&foo=def&' +
- 'foo=ghi&foo=jkl&foo=mno&foo=pqr&foo=stu&foo=vwxyz',
- manypairs: 'a&b&c&d&e&f&g&h&i&j&k&l&m&n&o&p&q&r&s&t&u&v&w&x&y&z'
-};
+const inputs = require('../fixtures/url-inputs.js').searchParams;
const bench = common.createBenchmark(main, {
type: Object.keys(inputs),
diff --git a/benchmark/url/legacy-vs-whatwg-url-searchparams-serialize.js b/benchmark/url/legacy-vs-whatwg-url-searchparams-serialize.js
index ef3160eccd..7e56b5fba6 100644
--- a/benchmark/url/legacy-vs-whatwg-url-searchparams-serialize.js
+++ b/benchmark/url/legacy-vs-whatwg-url-searchparams-serialize.js
@@ -2,18 +2,7 @@
const common = require('../common.js');
const { URLSearchParams } = require('url');
const querystring = require('querystring');
-
-const inputs = {
- noencode: 'foo=bar&baz=quux&xyzzy=thud',
- encodemany: '%66%6F%6F=bar&%62%61%7A=quux&xyzzy=%74h%75d',
- encodefake: 'foo=%©ar&baz=%A©uux&xyzzy=%©ud',
- encodelast: 'foo=bar&baz=quux&xyzzy=thu%64',
- multicharsep: 'foo=bar&&&&&&&&&&baz=quux&&&&&&&&&&xyzzy=thud',
- multivalue: 'foo=bar&foo=baz&foo=quux&quuy=quuz',
- multivaluemany: 'foo=bar&foo=baz&foo=quux&quuy=quuz&foo=abc&foo=def&' +
- 'foo=ghi&foo=jkl&foo=mno&foo=pqr&foo=stu&foo=vwxyz',
- manypairs: 'a&b&c&d&e&f&g&h&i&j&k&l&m&n&o&p&q&r&s&t&u&v&w&x&y&z'
-};
+const inputs = require('../fixtures/url-inputs.js').searchParams;
const bench = common.createBenchmark(main, {
type: Object.keys(inputs),
diff --git a/benchmark/url/legacy-vs-whatwg-url-serialize.js b/benchmark/url/legacy-vs-whatwg-url-serialize.js
index c0b7f5a6ce..911e79794b 100644
--- a/benchmark/url/legacy-vs-whatwg-url-serialize.js
+++ b/benchmark/url/legacy-vs-whatwg-url-serialize.js
@@ -3,19 +3,7 @@ const common = require('../common.js');
const url = require('url');
const URL = url.URL;
const assert = require('assert');
-
-const inputs = {
- long: 'http://nodejs.org:89/docs/latest/api/url.html#test?' +
- 'payload1=true&payload2=false&test=1&benchmark=3&' +
- 'foo=38.38.011.293&bar=1234834910480&test=19299&3992&' +
- 'key=f5c65e1e98fe07e648249ad41e1cfdb0',
- short: 'https://nodejs.org/en/blog/',
- idn: 'http://你好你好',
- auth: 'https://user:pass@example.com/path?search=1',
- special: 'file:///foo/bar/test/node.js',
- percent: 'https://%E4%BD%A0/foo',
- dot: 'https://example.org/./a/../b/./c'
-};
+const inputs = require('../fixtures/url-inputs.js').urls;
const bench = common.createBenchmark(main, {
type: Object.keys(inputs),