ultimate-express 1.2.7 → 1.2.8

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.
Files changed (2) hide show
  1. package/README.md +15 -13
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -34,23 +34,23 @@ Tested using [wrk](https://github.com/wg/wrk) (`-d 60 -t 1 -c 200`). Etag was di
34
34
  | routers/nested-routers (/abccc/nested/ddd) | 10.25k | 50.98k | 1.83 MB/sec | 7.98 MB/sec | **4.97X** |
35
35
  | middlewares/express-static (/static/index.js) | 7.52k | 31.08k | 6.92 MB/sec | 26.48 MB/sec | **4.13X** |
36
36
  | engines/ejs (/test) | 5.92k | 41.64k | 2.40 MB/sec | 16.55 MB/sec | **7.03X** |
37
- | middlewares/body-urlencoded (/abc) | 7.90k | 29.90k | 1.64 MB/sec | 5.36 MB/sec | **3.78X** |
37
+ | middlewares/body-urlencoded (/abc) | 8.01k | 35.10k | 1.66 MB/sec | 7.02 MB/sec | **4.38X** |
38
38
 
39
39
  ### Performance against other frameworks
40
40
 
41
41
  Tested using [bun-http-framework-benchmark](https://github.com/dimdenGD/bun-http-framework-benchmark). This table only includes Node.js results.
42
42
  For full table with other runtimes, check [here](https://github.com/dimdenGD/bun-http-framework-benchmark?tab=readme-ov-file#results).
43
43
 
44
- | Framework | Average | Ping | Query | Body |
45
- | ---------------- | ------- | ---------- | ---------- | ---------- |
46
- | uws | 94,296.49 | 108,551.92 | 104,756.22 | 69,581.33 |
47
- | hyper-express | 66,356.707 | 80,002.53 | 69,953.76 | 49,113.83 |
44
+ | Framework | Average | Ping | Query | Body |
45
+ | -------------------- | ------------- | ------------- | ------------- | ------------- |
46
+ | uws | 94,296.49 | 108,551.92 | 104,756.22 | 69,581.33 |
47
+ | hyper-express | 66,356.707 | 80,002.53 | 69,953.76 | 49,113.83 |
48
48
  | **ultimate-express** | **46,826.31** | **50,764.93** | **49,117.76** | **40,596.24** |
49
- | h3 | 35,423.263 | 41,243.68 | 34,429.26 | 30,596.85 |
50
- | fastify | 33,094.62 | 40,147.67 | 40,076.35 | 19,059.84 |
51
- | hono | 26,576.02 | 36,215.35 | 34,656.12 | 8,856.59 |
52
- | koa | 24,045.08 | 28,202.12 | 24,590.84 | 19,342.28 |
53
- | express | 10,411.313 | 11,245.57 | 10,598.74 | 9,389.63 |
49
+ | h3 | 35,423.263 | 41,243.68 | 34,429.26 | 30,596.85 |
50
+ | fastify | 33,094.62 | 40,147.67 | 40,076.35 | 19,059.84 |
51
+ | hono | 26,576.02 | 36,215.35 | 34,656.12 | 8,856.59 |
52
+ | koa | 24,045.08 | 28,202.12 | 24,590.84 | 19,342.28 |
53
+ | express | 10,411.313 | 11,245.57 | 10,598.74 | 9,389.63 |
54
54
 
55
55
  ### Performance on real-world application
56
56
 
@@ -107,9 +107,11 @@ Optimized routes can be up to 10 times faster than normal routes, as they're usi
107
107
 
108
108
  2. Do not use external `serve-static` module. Instead use built-in `express.static()` middleware, which is optimized for uExpress.
109
109
 
110
- 3. Do not set `body methods` to read body of requests with GET method or other methods that don't need a body. Reading body makes server about 10k req/sec slower.
110
+ 3. Do not use `body-parser` module. Instead use built-in `express.text()`, `express.json()` etc.
111
111
 
112
- 4. By default, µExpress creates 1 (or 0 if your CPU has only 1 core) child thread to improve performance of reading files. You can change this number by setting `threads` to a different number in `express()`, or set to 0 to disable thread pool (`express({ threads: 0 })`). Threads are shared between all express() instances, with largest `threads` number being used. Using more threads will not necessarily improve performance. Sometimes not using threads at all is faster, please [test](https://github.com/wg/wrk/) both options.
112
+ 4. Do not set `body methods` to read body of requests with GET method or other methods that don't need a body. Reading body makes server about 10k req/sec slower.
113
+
114
+ 5. By default, µExpress creates 1 (or 0 if your CPU has only 1 core) child thread to improve performance of reading files. You can change this number by setting `threads` to a different number in `express()`, or set to 0 to disable thread pool (`express({ threads: 0 })`). Threads are shared between all express() instances, with largest `threads` number being used. Using more threads will not necessarily improve performance. Sometimes not using threads at all is faster, please [test](https://github.com/wg/wrk/) both options.
113
115
 
114
116
  ## WebSockets
115
117
 
@@ -281,7 +283,7 @@ In general, basically all features and options are supported. Use [Express 4.x d
281
283
 
282
284
  Most of the middlewares that are compatible with Express are compatible with µExpress. Here's list of middlewares that we test for compatibility:
283
285
 
284
- - ✅ [body-parser](https://npmjs.com/package/body-parser)
286
+ - ✅ [body-parser](https://npmjs.com/package/body-parser) (use `express.text()` etc instead for better performance)
285
287
  - ✅ [cookie-parser](https://npmjs.com/package/cookie-parser)
286
288
  - ✅ [cookie-session](https://npmjs.com/package/cookie-session)
287
289
  - ✅ [serve-static](https://npmjs.com/package/serve-static) (use `express.static()` instead for better performance)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ultimate-express",
3
- "version": "1.2.7",
3
+ "version": "1.2.8",
4
4
  "description": "The Ultimate Express. Fastest http server with full Express compatibility, based on uWebSockets.",
5
5
  "main": "src/index.js",
6
6
  "scripts": {