mirror of
https://github.com/denoland/deno.git
synced 2024-11-22 15:06:54 -05:00
987c3d6aa8
This PR optimizes event dispatch by replacing `ReflectHas` with object lookup. I also made `isSlottable` return `false` since AFAIK there aren't any slottables nodes in Deno **This PR** ``` cpu: 13th Gen Intel(R) Core(TM) i9-13900H runtime: deno 1.36.1 (x86_64-unknown-linux-gnu) benchmark time (avg) iter/s (min … max) p75 p99 p995 --------------------------------------------------------------------- ----------------------------- event dispatch 80.46 ns/iter 12,428,739.4 (73.84 ns … 120.07 ns) 81.82 ns 86.34 ns 91.18 ns ``` **main** ``` cpu: 13th Gen Intel(R) Core(TM) i9-13900H runtime: deno 1.36.1 (x86_64-unknown-linux-gnu) benchmark time (avg) iter/s (min … max) p75 p99 p995 --------------------------------------------------------------------- ----------------------------- event dispatch 102.66 ns/iter 9,741,319.6 (96.66 ns … 132.88 ns) 104.18 ns 114.58 ns 118.45 ns ``` ```js const tg = new EventTarget(); const ev = new Event("foo"); const listener = () => {}; tg.addEventListener("foo", listener); Deno.bench("event dispatch ", () => { tg.dispatchEvent(ev); }); ``` towards https://github.com/denoland/deno/issues/20167 |
||
---|---|---|
.. | ||
broadcast_channel | ||
cache | ||
console | ||
crypto | ||
fetch | ||
ffi | ||
fs | ||
http | ||
io | ||
kv | ||
napi | ||
net | ||
node | ||
tls | ||
url | ||
web | ||
webidl | ||
websocket | ||
webstorage |