summaryrefslogtreecommitdiff
path: root/benchmark/querystring/querystring-parse.js
Commit message (Collapse)AuthorAgeFilesLines
* benchmark: pre-generate data set for URL benchmarksJoyee Cheung2018-11-201-1/+1
| | | | | | | | | | | | | | | | | This patch: - Introduces `common.bakeUrlData` which can be used to pre-generate the data set for the URL benchmarks to loop through instead of looping over a constant. - Add the option to use WPT data in benchmarks for better diversity in the input - Add the option to benchmark URL parsing with base URLs (whatwg only) - Moves the data in `benchmark/fixtures/url-inputs.js` to `benchmark/common.js` PR-URL: https://github.com/nodejs/node/pull/24302 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* benchmark: (querystring) use destructuringRuben Bridgewater2018-01-231-3/+1
| | | | | | PR-URL: https://github.com/nodejs/node/pull/18250 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* benchmark: var to constRuben Bridgewater2017-09-191-7/+7
| | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/13757 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
* benchmark: remove querystring forced optimizationBartosz Sosnowski2017-03-061-13/+2
| | | | | | | | | This removes all instances of %OptimizeFunctionOnNextCall from querystring benchmarks PR-URL: https://github.com/nodejs/node/pull/9615 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
* benchmark: clean up legacy url benchmarksJoyee Cheung2017-02-151-14/+1
| | | | | | | 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>
* querystring: fix empty pairs and optimize parse()Brian White2017-02-131-17/+23
| | | | | | | | | | | | | | | | | This commit fixes handling of empty pairs that occur before the end of the query string so that they are also ignored. Additionally, some optimizations have been made, including: * Avoid unnecessary code execution where possible * Use a lookup table when checking for hex characters * Avoid forced decoding when '+' characters are encountered and we are using the default decoder Fixes: https://github.com/nodejs/node/issues/10454 PR-URL: https://github.com/nodejs/node/pull/11234 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Nicu Micleușanu <micnic90@gmail.com>
* querystring: improve parse() performanceBrian White2017-01-251-21/+12
| | | | | PR-URL: https://github.com/nodejs/node/pull/10874 Reviewed-By: James M Snell <jasnell@gmail.com>
* benchmark: reformat code for clarityRich Trott2016-11-271-7/+11
| | | | | | | | | | | | | | | Some of the benchmark code can be a little dense. Not *very* hard to read but perhaps harder than it needs to be. These changes (many of them whitespace-only) hopefully improve readability. There are also a few cases of `assert.equal()` that are changed to `assert.strictEqual()`. PR-URL: https://github.com/nodejs/node/pull/9790 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
* benchmark: refactor to eliminate redeclared varsRich Trott2016-03-011-2/+3
| | | | | | | | | | In order to comply with linting rules used in the rest of the code base, eliminate redeclared variables. A conservative approach is used so as to avoid unintentional performance issues (for example, as might be seen in some situations when using `let` instead of `var`). PR-URL: https://github.com/nodejs/node/pull/5468 Reviewed-By: Brian White <mscdex@mscdex.net>
* benchmark: use strict modeRich Trott2016-02-221-0/+1
| | | | | | | | | | Apply strict mode to benchmark code. PR-URL: https://github.com/nodejs/node/pull/5336 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
* querystring: improve parse() performanceBrian White2016-02-121-10/+32
| | | | | | | | | | | | | | | | | | This commit improves parse() performance by ~20-200% with the various querystring-parse benchmarks. Some optimization strategies used in this commit include: * Combining multiple searches (for '&', '=', and '+') on the same string into a single loop * Avoiding string.split() * Minimizing creation of temporary strings * Avoiding string decoding if no encoded bytes were found and the default string decoder is being used PR-URL: https://github.com/nodejs/node/pull/5012 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
* querystring: improve parse() performanceBrian White2016-01-141-2/+3
| | | | | | | | | | 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>
* benchmark: add a few querystring benchmarksBrian White2015-02-141-0/+33
PR-URL: https://github.com/iojs/io.js/pull/847 Reviewed-By: Brendan Ashworth <brendan.ashworth@me.com>