1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-26 16:09:27 -05:00
denoland-deno/ext
Divy Srivastava 11b3bccf30
perf: avoid multiple calls to runMicrotask (#26378)
Improves HTTP throughput by 8-9k rps on Linux:

this patch
```
Requests/sec: 145001.69
Transfer/sec:     20.74MB
```

main
```
Requests/sec: 137866.61
Transfer/sec:     19.72MB
```

The improvements comes from the reduced number of calls to
`op_run_microtask` per request. Returning `true` from a macrotask
callback already calls `op_run_microtask` so the extra call was
redundant.

Here's `--strace-ops` output for a single request:

main
```
[     4.667] op_http_wait                                       : CompletedAsync Async
[     4.667] op_run_microtasks                                  : Dispatched Slow
[     4.668] op_http_try_wait                                   : Dispatched Slow
[     4.668] op_http_try_wait                                   : Completed Slow
[     4.668] op_http_wait                                       : Dispatched Async
[     4.668] op_http_set_response_header                        : Dispatched Slow
[     4.668] op_http_set_response_header                        : Completed Slow
[     4.669] op_http_set_response_body_text                     : Dispatched Slow
[     4.669] op_http_set_response_body_text                     : Completed Slow
[     4.669] op_run_microtasks                                  : Completed Slow
[     4.669] op_has_tick_scheduled                              : Dispatched Slow
[     4.669] op_has_tick_scheduled                              : Completed Slow
[     4.669] op_run_microtasks                                  : Dispatched Slow
[     4.669] op_run_microtasks                                  : Completed Slow
[     4.669] op_run_microtasks                                  : Dispatched Slow
[     4.669] op_run_microtasks                                  : Completed Slow
```

this pr
```
[     3.726] op_http_wait                                       : CompletedAsync Async
[     3.727] op_run_microtasks                                  : Dispatched Slow
[     3.727] op_http_try_wait                                   : Dispatched Slow
[     3.727] op_http_try_wait                                   : Completed Slow
[     3.727] op_http_wait                                       : Dispatched Async
[     3.727] op_http_set_response_header                        : Dispatched Slow
[     3.728] op_http_set_response_header                        : Completed Slow
[     3.728] op_http_set_response_body_text                     : Dispatched Slow
[     3.728] op_http_set_response_body_text                     : Completed Slow
[     3.728] op_run_microtasks                                  : Completed Slow
[     3.728] op_run_microtasks                                  : Dispatched Slow
[     3.728] op_run_microtasks                                  : Completed Slow
```
2024-10-25 02:09:34 +02:00
..
broadcast_channel 2.0.2 (#26374) 2024-10-18 01:28:36 +02:00
cache 2.0.2 (#26374) 2024-10-18 01:28:36 +02:00
canvas 2.0.2 (#26374) 2024-10-18 01:28:36 +02:00
console 2.0.2 (#26374) 2024-10-18 01:28:36 +02:00
cron 2.0.2 (#26374) 2024-10-18 01:28:36 +02:00
crypto refactor(ext/crypto): use concrete error types (#26167) 2024-10-25 02:09:33 +02:00
fetch refactor(ext/fetch): use concrete error types (#26220) 2024-10-25 02:09:33 +02:00
ffi 2.0.2 (#26374) 2024-10-18 01:28:36 +02:00
fs refactor(ext/fs): use concrete error types (#26317) 2024-10-25 02:09:32 +02:00
http refactor(ext/http): use concrete error types (#26377) 2024-10-25 02:09:33 +02:00
io 2.0.2 (#26374) 2024-10-18 01:28:36 +02:00
kv 2.0.2 (#26374) 2024-10-18 01:28:36 +02:00
napi 2.0.2 (#26374) 2024-10-18 01:28:36 +02:00
net 2.0.2 (#26374) 2024-10-18 01:28:36 +02:00
node perf: avoid multiple calls to runMicrotask (#26378) 2024-10-25 02:09:34 +02:00
tls 2.0.2 (#26374) 2024-10-18 01:28:36 +02:00
url 2.0.2 (#26374) 2024-10-18 01:28:36 +02:00
web 2.0.2 (#26374) 2024-10-18 01:28:36 +02:00
webgpu refactor(ext/webgpu): use concrete error type (#26198) 2024-10-25 02:09:33 +02:00
webidl 2.0.2 (#26374) 2024-10-18 01:28:36 +02:00
websocket refactor(ext/websocket): use concrete error type (#26226) 2024-10-25 02:09:32 +02:00
webstorage 2.0.2 (#26374) 2024-10-18 01:28:36 +02:00