querystring: improve stringify() performance

PR-URL: https://github.com/nodejs/node/pull/33669
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
This commit is contained in:
Brian White 2020-05-31 01:18:59 -04:00
parent 76ceaff270
commit 7b46793eee
No known key found for this signature in database
GPG key ID: 606D7358F94DA209
3 changed files with 47 additions and 14 deletions

View file

@ -3,7 +3,7 @@ const common = require('../common.js');
const querystring = require('querystring');
const bench = common.createBenchmark(main, {
type: ['noencode', 'encodemany', 'encodelast', 'array'],
type: ['noencode', 'encodemany', 'encodelast', 'array', 'multiprimitives'],
n: [1e6],
});
@ -28,7 +28,12 @@ function main({ type, n }) {
foo: [],
baz: ['bar'],
xyzzy: ['bar', 'quux', 'thud']
}
},
multiprimitives: {
foo: false,
bar: -13.37,
baz: '',
},
};
const input = inputs[type];