在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:mafintosh/turbo-http开源软件地址:https://github.com/mafintosh/turbo-http开源编程语言:JavaScript 100.0%开源软件介绍:turbo-httpA low level http library for Node.js based on turbo-net
WIP, this module is already really fast but there are some HTTP features missing and easy performance gains to be had. :D :D :D On my laptop I can serve simple hello world payloads at around 100k requests/seconds compared to 10k requests/second using node core. Usageconst turbo = require('turbo-http')
const server = turbo.createServer(function (req, res) {
res.setHeader('Content-Length', '11')
res.write(Buffer.from('hello world'))
})
server.listen(8080) API
|
Requests/s | Latency | Throughput/Mb | |
---|---|---|---|
turbo-http.js | 32592 | 3.03 | 2.43 |
bare-node.js | 18396 | 5.32 | 1.98 |
rayo.js | 16249.6 | 6.03 | 1.77 |
polka.js | 15802.4 | 6.2 | 1.71 |
fastify.js | 15141.6 | 6.47 | 2.26 |
express.js | 13408.8 | 7.31 | 1.46 |
hapi.js | 9675.6 | 10.15 | 1.42 |
Note: Nevermind these numbers, this benchmark was run on a slow computer and the above table is for illustrative purposes only.
Optionally, you may also define your test's parameters:
$> npm run bench -- -u http://localhost:5050 -c 100 -p 10 -d 5
-u
(url) -Defaults to http://localhost:5050
-c
(connections) -Defaults to 100
-p
(pipelines) -Defaults to 10
-d
(duration) -Defaults to 5
(seconds)This project was kindly sponsored by nearForm.
MIT
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论