1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-22 07:14:47 -05:00
denoland-deno/ext
Divy Srivastava 0710af034f
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-19 08:42:59 +05:30
..
broadcast_channel chore: forward v2.0.2 release commit to main (#26376) 2024-10-18 03:12:49 +02:00
cache chore: forward v2.0.2 release commit to main (#26376) 2024-10-18 03:12:49 +02:00
canvas chore: forward v2.0.2 release commit to main (#26376) 2024-10-18 03:12:49 +02:00
console chore: forward v2.0.2 release commit to main (#26376) 2024-10-18 03:12:49 +02:00
cron chore: forward v2.0.2 release commit to main (#26376) 2024-10-18 03:12:49 +02:00
crypto refactor(ext/crypto): use concrete error types (#26167) 2024-10-18 15:23:20 -07:00
fetch refactor(ext/fetch): use concrete error types (#26220) 2024-10-19 01:20:58 +00:00
ffi chore: forward v2.0.2 release commit to main (#26376) 2024-10-18 03:12:49 +02:00
fs refactor(ext/fs): use concrete error types (#26317) 2024-10-18 06:38:17 -07:00
http refactor(ext/http): use concrete error types (#26377) 2024-10-18 15:57:12 -07:00
io chore: forward v2.0.2 release commit to main (#26376) 2024-10-18 03:12:49 +02:00
kv chore: forward v2.0.2 release commit to main (#26376) 2024-10-18 03:12:49 +02:00
napi chore: forward v2.0.2 release commit to main (#26376) 2024-10-18 03:12:49 +02:00
net chore: forward v2.0.2 release commit to main (#26376) 2024-10-18 03:12:49 +02:00
node perf: avoid multiple calls to runMicrotask (#26378) 2024-10-19 08:42:59 +05:30
tls chore: forward v2.0.2 release commit to main (#26376) 2024-10-18 03:12:49 +02:00
url chore: forward v2.0.2 release commit to main (#26376) 2024-10-18 03:12:49 +02:00
web chore: forward v2.0.2 release commit to main (#26376) 2024-10-18 03:12:49 +02:00
webgpu refactor(ext/webgpu): use concrete error type (#26198) 2024-10-18 18:53:04 -07:00
webidl chore: forward v2.0.2 release commit to main (#26376) 2024-10-18 03:12:49 +02:00
websocket refactor(ext/websocket): use concrete error type (#26226) 2024-10-18 19:30:46 +00:00
webstorage chore: forward v2.0.2 release commit to main (#26376) 2024-10-18 03:12:49 +02:00