mirror of
https://github.com/nodejs/node.git
synced 2025-08-15 21:58:48 +02:00
querystring: simplify stringify method
PR-URL: https://github.com/nodejs/node/pull/26591 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
This commit is contained in:
parent
eb2dccb17a
commit
b965ac22ca
2 changed files with 11 additions and 6 deletions
|
@ -3,8 +3,8 @@ const common = require('../common.js');
|
|||
const querystring = require('querystring');
|
||||
|
||||
const bench = common.createBenchmark(main, {
|
||||
type: ['noencode', 'encodemany', 'encodelast'],
|
||||
n: [1e7],
|
||||
type: ['noencode', 'encodemany', 'encodelast', 'array'],
|
||||
n: [1e6],
|
||||
});
|
||||
|
||||
function main({ type, n }) {
|
||||
|
@ -23,6 +23,11 @@ function main({ type, n }) {
|
|||
foo: 'bar',
|
||||
baz: 'quux',
|
||||
xyzzy: 'thu\u00AC'
|
||||
},
|
||||
array: {
|
||||
foo: [],
|
||||
baz: ['bar'],
|
||||
xyzzy: ['bar', 'quux', 'thud']
|
||||
}
|
||||
};
|
||||
const input = inputs[type];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue