1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-27 09:39:08 -05:00
denoland-deno/ext/flash
Aapo Alasuutari 04ba709b6e
perf(ops): Remove unnecessary fast call fallback options usage (#17585)
Currently fast ops will always check for the alignment of a TypedArray
when getting a slice out of them. A match is then done to ensure that
some slice was received and if not a fallback will be requested.

For Uint8Arrays (and WasmMemory which is equivalent to a Uint8Array) the
alignment will always be okay. Rust probably optimises this away for the
most part (since the Uint8Array check is `x % 1 != 0`), but what it
cannot optimise away is the fast ops path's request for fallback options
parameter.

The extra parameter's cost is likely negligible but V8 will need to
check if a fallback was requested and prepare the fallback call just in
case it was. In the future the lack of a fallback may also enable V8 to
much better optimise the result handling.

For V8 created buffers, it seems like all buffers are actually always
guaranteed to be properly aligned: All buffers seem to always be created
8-byte aligned, and creating a 32 bit array or 64 bit array with a
non-aligned offset from an ArrayBuffer is not allowed. Unfortunately,
Deno FFI cannot give the same guarantees, and it is actually possible
for eg. 32 bit arrays to be created unaligned using it. These arrays
work fine (at least on Linux) so it seems like this is not illegal, it
just means that we cannot remove the alignment checking for 32 bit
arrays.
2023-01-29 19:35:08 +05:30
..
01_http.js chore: update dlint to v0.37.0 for GitHub Actions (#17295) 2023-01-16 17:17:18 +01:00
Cargo.toml 1.30.0 (#17532) 2023-01-26 00:15:08 +01:00
chunked.rs chore: add copyright_checker tool and add the missing copyright (#17285) 2023-01-13 16:51:32 +09:00
lib.rs perf(ops): Remove unnecessary fast call fallback options usage (#17585) 2023-01-29 19:35:08 +05:30
README.md feat(unstable): change Deno.serve() API (#15498) 2022-08-19 14:36:01 +02:00
request.rs chore: update copyright year to 2023 (#17247) 2023-01-02 21:00:42 +00:00
sendfile.rs chore: use rustfmt imports_granularity option (#17421) 2023-01-14 23:18:58 -05:00
socket.rs chore: use rustfmt imports_granularity option (#17421) 2023-01-14 23:18:58 -05:00

flash

Flash is a fast HTTP/1.1 server implementation for Deno.

serve({ fetch: (req) => new Response("Hello World") });