@ndiinginc/router 4.6.2 → 4.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -5
- package/package.json +3 -3
- package/src/response.js +2 -2
package/README.md
CHANGED
|
@@ -355,11 +355,12 @@ console.log(server.address().port);
|
|
|
355
355
|
|
|
356
356
|
Hello world dengan satu route `GET /`, diuji memakai `autocannon -c 100 -d 40 -p 10` di mesin lokal.
|
|
357
357
|
|
|
358
|
-
| | Req/
|
|
359
|
-
|
|
|
360
|
-
|
|
|
361
|
-
|
|
|
362
|
-
|
|
|
358
|
+
| package | Latency | Req/Sec | Bytes/Sec | Result |
|
|
359
|
+
| ----------------- | -------- | -------- | --------- | ------------------------------------- |
|
|
360
|
+
| fastify | 25.3 ms | 38,738.4 | 7.24 MB | 1550k requests in 40.06s, 290 MB read |
|
|
361
|
+
| @ndiinginc/router | 28.45 ms | 34,541.4 | 5.91 MB | 1383k requests in 40.06s, 236 MB read |
|
|
362
|
+
| express | 41 ms | 24,095.6 | 6.05 MB | 965k requests in 40.06s, 242 MB read |
|
|
363
|
+
|
|
363
364
|
|
|
364
365
|
Hasil bervariasi tergantung mesin, versi Node.js, dan jumlah route. Benchmark ini hanya menggambarkan overhead dasar, bukan performa aplikasi nyata.
|
|
365
366
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ndiinginc/router",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.7.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"type": "commonjs",
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@ndiinginc/commit": "^1.0.1",
|
|
22
|
-
"@ndiinginc/test": "^1.
|
|
22
|
+
"@ndiinginc/test": "^1.7.1",
|
|
23
23
|
"@types/jest": "^30.0.0",
|
|
24
|
-
"@types/node": "^26.6.
|
|
24
|
+
"@types/node": "^26.6.5"
|
|
25
25
|
}
|
|
26
26
|
}
|
package/src/response.js
CHANGED
|
@@ -7,7 +7,7 @@ class Response extends http.ServerResponse {
|
|
|
7
7
|
}
|
|
8
8
|
send(chunk) {
|
|
9
9
|
if (this.writableEnded) return;
|
|
10
|
-
this.end(chunk)
|
|
10
|
+
this.end(chunk,null,null);//avoid ArgumentsAdaptorTrampoline from V8
|
|
11
11
|
}
|
|
12
12
|
json(value) {
|
|
13
13
|
if (this.writableEnded) return;
|
|
@@ -16,7 +16,7 @@ class Response extends http.ServerResponse {
|
|
|
16
16
|
return;
|
|
17
17
|
}
|
|
18
18
|
this.setHeader("Content-Type", "application/json");
|
|
19
|
-
this.end(JSON.stringify(value))
|
|
19
|
+
this.end(JSON.stringify(value),null,null);//avoid ArgumentsAdaptorTrampoline from V8
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
exports.Response = Response;
|