summaryrefslogtreecommitdiff
path: root/ops/optimizer_tests/uint8array.expected
diff options
context:
space:
mode:
authorAapo Alasuutari <aapo.alasuutari@gmail.com>2023-01-29 16:05:08 +0200
committerGitHub <noreply@github.com>2023-01-29 19:35:08 +0530
commit04ba709b6ec994fd084e0d09ff9edc9df3a1eefc (patch)
tree7dc716f982393babcf1011352180866d8b00814e /ops/optimizer_tests/uint8array.expected
parent2c7855014498eeae4543aaf6934d3f2bcc818b79 (diff)
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.
Diffstat (limited to 'ops/optimizer_tests/uint8array.expected')
-rw-r--r--ops/optimizer_tests/uint8array.expected2
1 files changed, 1 insertions, 1 deletions
diff --git a/ops/optimizer_tests/uint8array.expected b/ops/optimizer_tests/uint8array.expected
index 0e5667a63..49554a2e8 100644
--- a/ops/optimizer_tests/uint8array.expected
+++ b/ops/optimizer_tests/uint8array.expected
@@ -3,7 +3,7 @@ returns_result: false
has_ref_opstate: false
has_rc_opstate: false
has_fast_callback_option: false
-needs_fast_callback_option: true
+needs_fast_callback_option: false
fast_result: Some(Bool)
fast_parameters: [V8Value, Uint8Array, Uint8Array]
transforms: {0: Transform { kind: SliceU8(false), index: 0 }, 1: Transform { kind: SliceU8(true), index: 1 }}