Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bifot/native-http-vs-koa2
Performance check between native http module vs koa2.
https://github.com/bifot/native-http-vs-koa2
api benchmarks http koa koa2 nodejs performance rest
Last synced: 22 days ago
JSON representation
Performance check between native http module vs koa2.
- Host: GitHub
- URL: https://github.com/bifot/native-http-vs-koa2
- Owner: bifot
- Created: 2018-12-11T16:55:03.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2018-12-11T16:58:21.000Z (about 6 years ago)
- Last Synced: 2024-10-30T03:44:11.407Z (2 months ago)
- Topics: api, benchmarks, http, koa, koa2, nodejs, performance, rest
- Language: Shell
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# native-http-vs-koa2
Performance check between native http module vs koa2.
## Servers
```js
const http = require('http');const app = http.createServer((req, res) => {
res.end('Hello, world!');
});app.listen(process.env.PORT);
```vs
```js
const Koa = require('koa');const app = new Koa();
app.use((ctx) => {
ctx.body = 'Hello, world!';
});app.listen(process.env.PORT);
```## Benchmarks
```sh
$ node -v # v8.12.0
$ bash ./benchmarks/http.sh # 104099 requests for 5 seconds
$ bash ./benchmarks/koa.sh # 87970 requests for 5 seconds
```