mirror of
https://github.com/nodejs/node.git
synced 2026-11-30 11:55:44 -05:00
querystring: improve parse() performance
These changes improve parse() performance from ~11-30% on all of the existing querystring benchmarks. PR-URL: https://github.com/nodejs/node/pull/4675 Reviewed-By: Johan Bergström <bugs@bergstroem.nu> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
1 parent
692eadaab0
commit
76b6a61297
2 files changed
+30
-5
No files matched your search
@@ -3,7 +3,7 @@ var querystring = require('querystring');
|
||||
var v8 = require('v8');
|
||||
|
||||
var bench = common.createBenchmark(main, {
|
||||
type: ['noencode', 'encodemany', 'encodelast'],
|
||||
type: ['noencode', 'encodemany', 'encodelast', 'multivalue'],
|
||||
n: [1e6],
|
||||
});
|
||||
|
||||
@@ -14,7 +14,8 @@ function main(conf) {
|
||||
var inputs = {
|
||||
noencode: 'foo=bar&baz=quux&xyzzy=thud',
|
||||
encodemany: '%66%6F%6F=bar&%62%61%7A=quux&xyzzy=%74h%75d',
|
||||
encodelast: 'foo=bar&baz=quux&xyzzy=thu%64'
|
||||
encodelast: 'foo=bar&baz=quux&xyzzy=thu%64',
|
||||
multivalue: 'foo=bar&foo=baz&foo=quux&quuy=quuz'
|
||||
};
|
||||
var input = inputs[type];
|
||||
|
||||
|
||||
Reference in new issue
Block a user