| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -185,7 +185,7 @@ exports.run = function(options, callback) { | |||
| 185 | 185 | port: exports.PORT, | |
| 186 | 186 | path: '/', | |
| 187 | 187 | connections: 100, | |
| 188 | - duration: 10, | ||
| 188 | + duration: 5, | ||
| 189 | 189 | benchmarker: exports.default_http_benchmarker | |
| 190 | 190 | }, options); | |
| 191 | 191 | if (!options.benchmarker) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,32 @@ | |||
| 1 | + 'use strict'; | ||
| 2 | + const common = require('../common.js'); | ||
| 3 | + const PORT = common.PORT; | ||
| 4 | + | ||
| 5 | + const bench = common.createBenchmark(main, { | ||
| 6 | + res: ['normal', 'setHeader', 'setHeaderWH'] | ||
| 7 | + }); | ||
| 8 | + | ||
| 9 | + const type = 'bytes'; | ||
| 10 | + const len = 4; | ||
| 11 | + const chunks = 0; | ||
| 12 | + const chunkedEnc = 0; | ||
| 13 | + const c = 50; | ||
| 14 | + | ||
| 15 | + // normal: writeHead(status, {...}) | ||
| 16 | + // setHeader: statusCode = status, setHeader(...) x2 | ||
| 17 | + // setHeaderWH: setHeader(...), writeHead(status, ...) | ||
| 18 | + function main({ res }) { | ||
| 19 | + process.env.PORT = PORT; | ||
| 20 | + var server = require('../fixtures/simple-http-server.js') | ||
| 21 | + .listen(PORT) | ||
| 22 | + .on('listening', function() { | ||
| 23 | + const path = `/${type}/${len}/${chunks}/normal/${chunkedEnc}`; | ||
| 24 | + | ||
| 25 | + bench.http({ | ||
| 26 | + path: path, | ||
| 27 | + connections: c | ||
| 28 | + }, function() { | ||
| 29 | + server.close(); | ||
| 30 | + }); | ||
| 31 | + }); | ||
| 32 | + } | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -7,15 +7,14 @@ const bench = common.createBenchmark(main, { | |||
| 7 | 7 | len: [4, 1024, 102400], | |
| 8 | 8 | chunks: [1, 4], | |
| 9 | 9 | c: [50, 500], | |
| 10 | - chunkedEnc: [1, 0], | ||
| 11 | - res: ['normal', 'setHeader', 'setHeaderWH'] | ||
| 10 | + chunkedEnc: [1, 0] | ||
| 12 | 11 | }); | |
| 13 | 12 | ||
| 14 | 13 | function main({ type, len, chunks, c, chunkedEnc, res }) { | |
| 15 | 14 | var server = require('../fixtures/simple-http-server.js') | |
| 16 | 15 | .listen(common.PORT) | |
| 17 | 16 | .on('listening', function() { | |
| 18 | - const path = `/${type}/${len}/${chunks}/${res}/${chunkedEnc}`; | ||
| 17 | + const path = `/${type}/${len}/${chunks}/normal/${chunkedEnc}`; | ||
| 19 | 18 | ||
| 20 | 19 | bench.http({ | |
| 21 | 20 | path: path, | |
| Back | FazBrowse Home | New Git URL |
0 commit comments