summaryrefslogtreecommitdiff
path: root/benchmark/http
AgeCommit message (Collapse)Author
2018-04-27http: refactor outgoing headers processingAnatoli Papirovski
Use a shared function, for..in instead of Object.keys, do less work in `setHeader` and instead defer some of it until later, and other minor changes to improve clarity, as well as a slight boost in performance. PR-URL: https://github.com/nodejs/node/pull/20250 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-04-22test: fix long-running http benchmarksAnatoli Papirovski
PR-URL: https://github.com/nodejs/node/pull/20125 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Rich Trott <rtrott@gmail.com>
2018-02-22tools: enable eslint strict key-spacingRuben Bridgewater
PR-URL: https://github.com/nodejs/node/pull/18831 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Matheus Marchini <matheus@sthima.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-02-16http: simplify checkInvalidHeaderCharSeth Brenith
In the spirit of [17399](https://github.com/nodejs/node/pull/17399), we can also simplify checkInvalidHeaderChar to use regex matching instead of a loop. This makes it faster on long matches and slower on short matches or non-matches. This change also includes some sample data from an AcmeAir benchmark run, as a rough proxy for real-world data. PR-URL: https://github.com/nodejs/node/pull/18381 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Benedikt Meurer <benedikt.meurer@gmail.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
2018-02-01benchmark: shorten config name in http benchmarkJoyee Cheung
Shorten the config name in check_invalid_header_char so it would not result in long lines that make the benchmark result hard to read. PR-URL: https://github.com/nodejs/node/pull/18452 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Weijia Wang <starkwang@126.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-02-01benchmark: cut down http benchmark run timeJoyee Cheung
PR-URL: https://github.com/nodejs/node/pull/18379 Reviewed-By: Jon Moss <me@jonathanmoss.me> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-02-01benchmark: (http(2)) refactorRuben Bridgewater
PR-URL: https://github.com/nodejs/node/pull/18320 Reviewed-By: James M Snell <jasnell@gmail.com>
2018-01-31test: move tmpdir to submodule of commonRich Trott
Move tmpdir functionality to its own module (common/tmpdir). PR-URL: https://github.com/nodejs/node/pull/17856 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2018-01-26http: switch on string valuesSeth Brenith
Long ago, V8 was much faster switching on string lengths than values. That is no longer the case, so we can simplify a couple of methods. PR-URL: https://github.com/nodejs/node/pull/18351 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Kyle Farnung <kfarnung@microsoft.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Jon Moss <me@jonathanmoss.me>
2018-01-23benchmark: (http) use destructuringRuben Bridgewater
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>
2017-12-15stream: add flow and buffer properties to streamsCalvin Metcalf
This adds computed properties to readable and writable streams to allow access to the readable buffer, the writable buffer, and flow state without accessing the readable or writable state. These are the only uses of readable and writable state in the docs so adding these work arounds allows them to be removed from the docs. This also updates net, http_client and http_server to use the new methods instead of manipulating readable and writable state directly. See: https://github.com/nodejs/node/issues/445 PR-URL: https://github.com/nodejs/node/pull/12855 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com>
2017-12-11benchmark: fix http/simple.js benchmarkAnatoli Papirovski
autocannon appears to have trouble recognizing URLs that contain true or false within them. Use 0 or 1 instead to represent the same. PR-URL: https://github.com/nodejs/node/pull/17583 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
2017-09-19benchmark: var to constRuben Bridgewater
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>
2017-09-19benchmark: use smaller n value in some http testsPeter Marshall
PR-URL: https://github.com/nodejs/node/pull/14002 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com>
2017-07-14test: make common.PIPE process uniqueRefael Ackermann
* includes a tiny bit of refactoring in adjacent lines. * fixes 1 test and 1 benchmark that depended on PIPE being constant. PR-URL: https://github.com/nodejs/node/pull/14168 Fixes: https://github.com/nodejs/node/issues/14128 Reviewed-By: James M Snell <jasnell@gmail.com>
2017-06-12http: always cork outgoing writesBrian White
PR-URL: https://github.com/nodejs/node/pull/13522 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
2017-05-13benchmark: chunky http client should exit with 0Joyee Cheung
Previously when there is an error in the chunky client of the http benchmark, the server would not check the exit code and thus produce invalid results. PR-URL: https://github.com/nodejs/node/pull/12916 Fixes: https://github.com/nodejs/node/issues/12903 Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2017-05-08benchmark: update an obsolete pathVse Mozhet Byt
PR-URL: https://github.com/nodejs/node/pull/12904 Refs: https://github.com/nodejs/node/issues/12903 Refs: https://github.com/nodejs/node/commit/ff001c1 Reviewed-By: Anna Henningsen <anna@addaleax.net>
2017-05-03test: move WPT to its own testing moduleRich Trott
This is first in a hoped-for series of moves away from a monolithic common.js that is loaded for every test and towards a more modular approach. (In the end, common.js will hopefully contain checks for variables leaking into the global space and perhaps some of the more ubiquitous functions like common.mustCall().) Move the WPT testing code to its own module. PR-URL: https://github.com/nodejs/node/pull/12736 Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2017-04-20benchmark: reduce string concatenationsVse Mozhet Byt
PR-URL: https://github.com/nodejs/node/pull/12455 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2017-04-13benchmark: replace more [].join() with ''.repeat()Vse Mozhet Byt
Refs: https://github.com/nodejs/node/pull/12170 PR-URL: https://github.com/nodejs/node/pull/12317 Reviewed-By: James M Snell <jasnell@gmail.com>
2017-04-09benchmark: control HTTP benchmarks run timeJoyee Cheung
PR-URL: https://github.com/nodejs/node/pull/12121 Refs: https://github.com/nodejs/node/issues/12068 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2017-04-04benchmark: replace [].join() with ''.repeat()Vse Mozhet Byt
Also add a benchmark to compare both ways to create strings. PR-URL: https://github.com/nodejs/node/pull/12170 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2017-01-13benchmark: add ClientRequest creation benchmarkBrian White
PR-URL: https://github.com/nodejs/node/pull/10654 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
2017-01-11benchmark: add http header setting scenariosBrian White
PR-URL: https://github.com/nodejs/node/pull/10558 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com>
2016-11-27benchmark: reformat code for clarityRich Trott
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>
2016-08-31benchmark: support for multiple http benchmarkersBartosz Sosnowski
This adds support for multiple HTTP benchmarkers. Adds autocannon as the secondary benchmarker. PR-URL: https://github.com/nodejs/node/pull/8140 Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2016-08-09benchmark: favor === over ==Rich Trott
Refs: https://github.com/nodejs/node/pull/7961#discussion_r73788501 PR-URL: https://github.com/nodejs/node/pull/8000 Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: Andreas Madsen <amwebdk@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
2016-07-26benchmark: missing process.exit after bench.endAndreas Madsen
Previously bench.end would call process.exit(0) however this is rather confusing and indeed a few benchmarks had code that assumed otherwise. This adds process.exit(0) to the benchmarks that needs it. PR-URL: https://github.com/nodejs/node/pull/7094 Reviewed-By: Trevor Norris <trev.norris@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: Anna Henningsen <anna@addaleax.net>
2016-07-26benchmark: refactor to use process.sendAndreas Madsen
This removes the need for parsing stdout from the benchmarks. If the process wasn't executed by fork, it will just print like it used to. This also fixes the parsing of CLI arguments, by inferring the type from the options object instead of the value content. Only two benchmarks had to be changed: * http/http_server_for_chunky_client.js this previously used a spawn now it uses a fork and relays the messages using common.sendResult. * misc/v8-bench.js this utilized that v8/benchmark/run.js called global.print and reformatted the input. It now interfaces directly with the benchmark runner global.BenchmarkSuite. PR-URL: https://github.com/nodejs/node/pull/7094 Reviewed-By: Trevor Norris <trev.norris@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: Anna Henningsen <anna@addaleax.net>
2016-07-26benchmark: move http_simple.js to http directoryAndreas Madsen
PR-URL: https://github.com/nodejs/node/pull/7094 Reviewed-By: Trevor Norris <trev.norris@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: Anna Henningsen <anna@addaleax.net>
2016-07-10benchmark: remove unused variablesRich Trott
Remove variables that are assigned but never used. (This was missed by the linter in previous versions of ESLint but is flagged by the current version. Updating the linter is contingent on this change or some similar remedy landing.) PR-URL: https://github.com/nodejs/node/pull/7600 Reviewed-By: Rod Vagg <rod@vagg.org> Reviewed-By: Michaël Zasso <mic.besace@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2016-06-14benchmark: increase http token check iterationsBrian White
PR-URL: https://github.com/nodejs/node/pull/6570 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2016-06-14http: optimize checkInvalidHeaderChar()Brian White
This commit optimizes checkInvalidHeaderChar() by unrolling the character checking loop a bit. Additionally, some changes to the benchmark runner are needed in order for the included benchmark to be run correctly. Specifically, the regexp used to parse `key=value` parameters contained a greedy quantifier that was causing the `key` to match part of the `value` if `value` contained an equals sign. PR-URL: https://github.com/nodejs/node/pull/6570 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
2016-03-27http: speed up checkIsHttpTokenJackson Tian
The Regex implementation is not faster than ascii code compare. the field name is shorter, the speed is faster. benchmark result here: https://bitbucket.org/snippets/JacksonTian/Rnbad/benchmark-result PR-URL: https://github.com/nodejs/node/pull/4790 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Brian White <mscdex@mscdex.net>
2016-03-16buffer: add .from(), .alloc() and .allocUnsafe()James M Snell
Several changes: * Soft-Deprecate Buffer() constructors * Add `Buffer.from()`, `Buffer.alloc()`, and `Buffer.allocUnsafe()` * Add `--zero-fill-buffers` command line option * Add byteOffset and length to `new Buffer(arrayBuffer)` constructor * buffer.fill('') previously had no effect, now zero-fills * Update the docs PR-URL: https://github.com/nodejs/node/pull/4682 Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
2016-02-27tools,benchmark: increase lint complianceRich Trott
In the hopes of soon having the benchmark code linted, this change groups all the likely non-controversial lint-compliance changes such as indentation, semi-colon usage, and single-vs.-double quotation marks. Other lint rules may have subtle performance implications in the V8 currently shipped with Node.js. Those changes will require more careful review and will be in a separate change. PR-URL: https://github.com/nodejs/node/pull/5429 Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Brian White <mscdex@mscdex.net>
2016-02-22benchmark: use strict modeRich Trott
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>
2015-12-17http_parser: use pushValueToArray for headersTrevor Norris
For performance add headers to the headers Array by pushing them on from JS. Benchmark added to demonstrate this case. PR-URL: https://github.com/nodejs/node/pull/3780 Reviewed-By: Fedor Indutny <fedor@indutny.com>
2015-04-03benchmark: fix chunky client benchmark executionBrian White
This commit fixes a few things for this benchmark: 1. Ensures the temporary directory for the unix socket exists. 2. Prevents the client code from being run directly because the server script is the one that calls out the client code. 3. Ensures the server is closed once the client benchmarks have finished. 4. Since this is an http benchmark, it should be moved to the http benchmarks subdirectory. PR-URL: https://github.com/iojs/io.js/pull/1257 Reviewed-By: Roman Reiss <me@silverwind.io>
2015-01-30benchmark: remove extra spacing in http optionsBrendan Ashworth
This commit removes the benchmark spacing modification in `client-request-body.js` and `end-vs-write-end.js` which adds two spaces to the end of some variables to make sure the lines line up. The reason behind this is that its totally pointless (the lines don't actually line up with it) and it disallows you to parse the output with a tool like awk, or at least makes it a lot harder. PR-URL: https://github.com/iojs/io.js/pull/650 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2014-02-25benchmark: update to use new wrkTimothy J Fontaine
2013-11-01benchmark: add http chunked encoding benchmarksBen Noordhuis
Test both "Content-Length: xxx" and "Transfer-Encoding: chunked" responses in the http/simple benchmark.
2013-05-27Merge remote-tracking branch 'ry/v0.10'isaacs
Conflicts: AUTHORS ChangeLog configure deps/uv/ChangeLog deps/uv/src/unix/darwin.c deps/uv/src/unix/stream.c deps/uv/src/version.c deps/v8/src/isolate.cc deps/v8/src/version.cc lib/http.js src/node_version.h
2013-05-23http: save roundtrips, convert buffers to stringsBen Noordhuis
This commit adds an optimization to the HTTP client that makes it possible to: * Pack the headers and the first chunk of the request body into a single write(). * Pack the chunk header and the chunk itself into a single write(). Because only one write() system call is issued instead of several, the chances of data ending up in a single TCP packet are phenomenally higher: the benchmark with `type=buf size=32` jumps from 50 req/s to 7,500 req/s, a 150-fold increase. This commit removes the check from e4b716ef that pushes binary encoded strings into the slow path. The commit log mentions that: We were assuming that any string can be concatenated safely to CRLF. However, for hex, base64, or binary encoded writes, this is not the case, and results in sending the incorrect response. For hex and base64 strings that's certainly true but binary strings are 'das Ding an sich': string.length is the same before and after decoding. Fixes #5528.
2013-04-27benchmark: add chunked-encoding benchmarkFedor Indutny
2013-03-14http: Don't hot-path end() for large buffersisaacs
The benefits of the hot-path optimization below start to fall off when the buffer size gets up near 128KB, because the cost of the copy is more than the cost of the extra write() call. Switch to the write/end method at that point. Heuristics and magic numbers are awful, but slow http responses are worse. Fix #4975
2013-02-25bench: Make http easier to profileisaacs
Do not run the http/simple.js server in a child process. Fix #4831
2013-02-19bench: Consistency in benchmark filenamesisaacs
2013-02-19bench: Use wrk for http benchmarkingisaacs
Remove ab, since it's no longer used.