1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-02 17:01:14 -05:00
denoland-deno/ext/node
Marcos Casagrande 3a238ef6da perf(ext/node): cache IncomingMessageForServer.headers (#20147)
This PR adds caching to node's `req.headers`

```js
import express from "npm:express";
const app = express();

app.get("/", function (req, res) {
  const ua = req.header("User-Agent");
  const auth = req.header("Authorization");
  const type = req.header("Content-Type");
  const ip = req.header("X-Forwarded-For");
  res.end();
});

app.listen(3000);
```

**this PR**
```
wrk -d 10s --latency http://127.0.0.1:3000
Running 10s test @ http://127.0.0.1:3000
  2 threads and 10 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   155.64us  152.14us   5.74ms   97.39%
    Req/Sec    35.00k     1.97k   39.10k    80.69%
  Latency Distribution
     50%  123.00us
     75%  172.00us
     90%  214.00us
     99%  563.00us
  703420 requests in 10.10s, 50.31MB read
Requests/sec:  69648.45
Transfer/sec:      4.98MB
```

**main**
```
wrk -d 10s --latency http://127.0.0.1:3000
Running 10s test @ http://127.0.0.1:3000
  2 threads and 10 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   217.95us  786.89us  26.26ms   98.23%
    Req/Sec    32.32k     2.54k   37.19k    87.13%
  Latency Distribution
     50%  130.00us
     75%  191.00us
     90%  232.00us
     99%    1.88ms
  649411 requests in 10.10s, 46.45MB read
Requests/sec:  64300.44
Transfer/sec:      4.60MB
```
2023-08-21 17:00:44 +05:30
..
ops fix(ext/node): support dictionary option in zlib init (#20035) 2023-08-21 17:00:44 +05:30
polyfills perf(ext/node): cache IncomingMessageForServer.headers (#20147) 2023-08-21 17:00:44 +05:30
analyze.rs chore: rename some helpers on the Fs trait (#20097) 2023-08-08 16:28:18 -04:00
build.rs build: allow disabling snapshots for dev (#20048) 2023-08-06 01:47:15 +02:00
Cargo.toml 1.36.0 (#20036) 2023-08-03 18:26:25 +02:00
clippy.toml refactor(ext/fs): deno_fs::FileSystem - conditional Send + Sync (#18993) 2023-05-08 11:02:02 -04:00
errors.rs fix(node): package path not exported error - add if types resolution was occurring (#19963) 2023-07-27 16:27:01 +00:00
global.rs perf: cache node resolution when accesing a global (#19930) 2023-07-25 23:43:00 +02:00
lib.rs build: allow disabling snapshots for dev (#20048) 2023-08-06 01:47:15 +02:00
package_json.rs chore: rename some helpers on the Fs trait (#20097) 2023-08-08 16:28:18 -04:00
path.rs chore(ext/node): fix variable name (#17948) 2023-02-27 21:26:02 +01:00
polyfill.rs fix(node): repl._builtinLibs (#20046) 2023-08-04 14:30:48 +02:00
README.md chore(ext/node): correct publishing for ext/node (#15461) 2022-08-11 17:25:41 -04:00
resolution.rs chore: rename some helpers on the Fs trait (#20097) 2023-08-08 16:28:18 -04:00

deno_node

require and other node related functionality for Deno.