deno/ext
Marcos Casagrande 65a94a6176
perf(ext/fetch): use new instead of createBranded (#20624)
This PR optimizes `fromInner*` methods of `Request` / `Header` /
`Response` used by `Deno.serve` and `fetch` by using `new` instead of
`ObjectCreate` from `createBranded`.

The "brand" is created by passing `webidl.brand` to the constructor
instead.


142449ecab/ext/webidl/00_webidl.js (L1001-L1005)

### Benchmark
```js
const createBranded = Symbol("create branded");
const brand = Symbol("brand");
class B {
  constructor(init) {
    if (init === createBranded) {
      this[brand] = brand;
    }
  }
}

Deno.bench("Object.create(protoype)", () => {
  Object.create(B.prototype);
});

Deno.bench("new Class", () => {
  new B(createBranded);
});
```

```
cpu: 13th Gen Intel(R) Core(TM) i9-13900H
runtime: deno 1.37.0 (x86_64-unknown-linux-gnu)

benchmark                    time (avg)        iter/s             (min … max)       p75       p99      p995
----------------------------------------------------------------------------- -----------------------------
Object.create(protoype)       8.74 ns/iter 114,363,610.3    (7.32 ns … 26.02 ns)   8.65 ns  13.39 ns  14.47 ns
new Class                     3.05 ns/iter 328,271,012.2      (2.78 ns … 9.1 ns)   3.06 ns   3.46 ns    3.5 ns
```
2023-09-21 20:06:42 -06:00
..
broadcast_channel refactor: rewrite BC, cache exts to op2 (#20486) 2023-09-19 20:39:27 -06:00
cache refactor: rewrite BC, cache exts to op2 (#20486) 2023-09-19 20:39:27 -06:00
console 1.37.0 (#20574) 2023-09-19 20:29:17 +00:00
crypto refactor: rewrite some ops to op2 macro (#20603) 2023-09-21 08:08:23 -06:00
fetch perf(ext/fetch): use new instead of createBranded (#20624) 2023-09-21 20:06:42 -06:00
ffi 1.37.0 (#20574) 2023-09-19 20:29:17 +00:00
fs 1.37.0 (#20574) 2023-09-19 20:29:17 +00:00
http 1.37.0 (#20574) 2023-09-19 20:29:17 +00:00
io 1.37.0 (#20574) 2023-09-19 20:29:17 +00:00
kv 1.37.0 (#20574) 2023-09-19 20:29:17 +00:00
napi 1.37.0 (#20574) 2023-09-19 20:29:17 +00:00
net 1.37.0 (#20574) 2023-09-19 20:29:17 +00:00
node fix(node): point process.version to Node 18.18.0 LTS (#20597) 2023-09-21 06:44:37 +00:00
tls 1.37.0 (#20574) 2023-09-19 20:29:17 +00:00
url 1.37.0 (#20574) 2023-09-19 20:29:17 +00:00
web fix(ext/web): Aggregate small packets for Resource implementation of ReadableStream (#20570) 2023-09-20 11:23:58 -06:00
webidl 1.37.0 (#20574) 2023-09-19 20:29:17 +00:00
websocket 1.37.0 (#20574) 2023-09-19 20:29:17 +00:00
webstorage 1.37.0 (#20574) 2023-09-19 20:29:17 +00:00