| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -14,7 +14,6 @@ const bench = common.createBenchmark(main, { | |||
| 14 | 14 | n: [1e5], | |
| 15 | 15 | }); | |
| 16 | 16 | ||
| 17 | - | ||
| 18 | 17 | function main({ len, n }) { | |
| 19 | 18 | var header = `GET /hello HTTP/1.1${CRLF}Content-Type: text/plain${CRLF}`; | |
| 20 | 19 | ||
@@ -26,7 +25,6 @@ function main({ len, n }) { | |||
| 26 | 25 | processHeader(Buffer.from(header), n); | |
| 27 | 26 | } | |
| 28 | 27 | ||
| 29 | - | ||
| 30 | 28 | function processHeader(header, n) { | |
| 31 | 29 | const parser = newParser(REQUEST); | |
| 32 | 30 | ||
@@ -38,7 +36,6 @@ function processHeader(header, n) { | |||
| 38 | 36 | bench.end(n); | |
| 39 | 37 | } | |
| 40 | 38 | ||
| 41 | - | ||
| 42 | 39 | function newParser(type) { | |
| 43 | 40 | const parser = new HTTPParser(type); | |
| 44 | 41 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,6 +1,5 @@ | |||
| 1 | 1 | 'use strict'; | |
| 2 | 2 | const common = require('../common.js'); | |
| 3 | - const PORT = common.PORT; | ||
| 4 | 3 | ||
| 5 | 4 | const bench = common.createBenchmark(main, { | |
| 6 | 5 | // unicode confuses ab on os x. | |
@@ -13,9 +12,8 @@ const bench = common.createBenchmark(main, { | |||
| 13 | 12 | }); | |
| 14 | 13 | ||
| 15 | 14 | function main({ type, len, chunks, c, chunkedEnc, res }) { | |
| 16 | - process.env.PORT = PORT; | ||
| 17 | 15 | var server = require('../fixtures/simple-http-server.js') | |
| 18 | - .listen(PORT) | ||
| 16 | + .listen(common.PORT) | ||
| 19 | 17 | .on('listening', function() { | |
| 20 | 18 | const path = `/${type}/${len}/${chunks}/${res}/${chunkedEnc}`; | |
| 21 | 19 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,7 +1,6 @@ | |||
| 1 | 1 | 'use strict'; | |
| 2 | 2 | ||
| 3 | 3 | const common = require('../common.js'); | |
| 4 | - const PORT = common.PORT; | ||
| 5 | 4 | const net = require('net'); | |
| 6 | 5 | ||
| 7 | 6 | const bench = common.createBenchmark(main, { | |
@@ -20,7 +19,6 @@ const resData = 'HTTP/1.1 101 Web Socket Protocol Handshake\r\n' + | |||
| 20 | 19 | '\r\n\r\n'; | |
| 21 | 20 | ||
| 22 | 21 | function main({ n }) { | |
| 23 | - process.env.PORT = PORT; | ||
| 24 | 22 | var server = require('../fixtures/simple-http-server.js') | |
| 25 | 23 | .listen(common.PORT) | |
| 26 | 24 | .on('listening', function() { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,7 +1,6 @@ | |||
| 1 | 1 | 'use strict'; | |
| 2 | 2 | ||
| 3 | 3 | const common = require('../common.js'); | |
| 4 | - const PORT = common.PORT; | ||
| 5 | 4 | const path = require('path'); | |
| 6 | 5 | const fs = require('fs'); | |
| 7 | 6 | ||
@@ -25,7 +24,7 @@ function main({ requests, streams, clients }) { | |||
| 25 | 24 | stream.respondWithFD(fd); | |
| 26 | 25 | stream.on('error', (err) => {}); | |
| 27 | 26 | }); | |
| 28 | - server.listen(PORT, () => { | ||
| 27 | + server.listen(common.PORT, () => { | ||
| 29 | 28 | bench.http({ | |
| 30 | 29 | path: '/', | |
| 31 | 30 | requests, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,11 +1,8 @@ | |||
| 1 | 1 | 'use strict'; | |
| 2 | 2 | ||
| 3 | 3 | const common = require('../common.js'); | |
| 4 | - const PORT = common.PORT; | ||
| 5 | - | ||
| 6 | 4 | const path = require('path'); | |
| 7 | 5 | const fs = require('fs'); | |
| 8 | - | ||
| 9 | 6 | const file = path.join(path.resolve(__dirname, '../fixtures'), 'alice.html'); | |
| 10 | 7 | ||
| 11 | 8 | const bench = common.createBenchmark(main, { | |
@@ -24,7 +21,7 @@ function main({ requests, streams, clients }) { | |||
| 24 | 21 | out.pipe(stream); | |
| 25 | 22 | stream.on('error', (err) => {}); | |
| 26 | 23 | }); | |
| 27 | - server.listen(PORT, () => { | ||
| 24 | + server.listen(common.PORT, () => { | ||
| 28 | 25 | bench.http({ | |
| 29 | 26 | path: '/', | |
| 30 | 27 | requests, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,7 +1,6 @@ | |||
| 1 | 1 | 'use strict'; | |
| 2 | 2 | ||
| 3 | 3 | const common = require('../common.js'); | |
| 4 | - const PORT = common.PORT; | ||
| 5 | 4 | ||
| 6 | 5 | const bench = common.createBenchmark(main, { | |
| 7 | 6 | streams: [100, 200, 1000], | |
@@ -26,7 +25,7 @@ function main({ streams, length, size }) { | |||
| 26 | 25 | } | |
| 27 | 26 | write(); | |
| 28 | 27 | }); | |
| 29 | - server.listen(PORT, () => { | ||
| 28 | + server.listen(common.PORT, () => { | ||
| 30 | 29 | bench.http({ | |
| 31 | 30 | path: '/', | |
| 32 | 31 | requests: 10000, | |
| Back | FazBrowse Home | New Git URL |
0 commit comments