1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-28 16:20:57 -05:00

perf(ext/websocket): use internal dispatch for msg events (#18904)

```
Linux divy-2 5.19.0-1022-gcp #24~22.04.1-Ubuntu SMP Sun Apr 23 09:51:08 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
32GiB System memory
Intel(R) Xeon(R) CPU @ 3.10GHz

# main
Msg/sec: 89398.250000
Msg/sec: 90079.750000

# this patch
Msg/sec: 91919.750000
Msg/sec: 91762.250000
```
This commit is contained in:
Divy Srivastava 2023-04-30 15:54:56 +05:30 committed by GitHub
parent 74bb09aa38
commit 314799bc4f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View file

@ -1527,6 +1527,7 @@ export {
CloseEvent,
CustomEvent,
defineEventHandler,
dispatch,
ErrorEvent,
Event,
EventTarget,

View file

@ -15,6 +15,7 @@ import {
_skipInternalInit,
CloseEvent,
defineEventHandler,
dispatch,
ErrorEvent,
Event,
EventTarget,
@ -451,7 +452,7 @@ class WebSocket extends EventTarget {
data: value,
origin: this[_url],
});
this.dispatchEvent(event);
dispatch(this, event);
break;
}
case 1: {
@ -470,7 +471,7 @@ class WebSocket extends EventTarget {
origin: this[_url],
[_skipInternalInit]: true,
});
this.dispatchEvent(event);
dispatch(this, event);
break;
}
case 2: {