Commit d2ce8e7
[dart2wasm] Remove short input threshold to fall back to native UTF-8 decoder
When decoding a JS array input as UTF-8 we currently fall back to the
decoder implemented in Dart when the input is small.
When benchmarked with `benchmark_harness`, for one byte array, I get
6.0us when decoded with the Dart decoder, and 5.8us when decoded with JS
`TextDecoder`.
So it looks like Dart decoder is never faster when the input is a JS
array. Remove the threshold and always call JS when the input is a JS
array.
(This threshold was copied from dart2js, where accessing JS data is less
expensive.)
Change-Id: I1a34fd1f38718e34a1ff7bac0d7c6178bf6dd469
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405002
Reviewed-by: Martin Kustermann <[email protected]>
Commit-Queue: Ömer Ağacan <[email protected]>1 parent b93c826 commit d2ce8e7
1 file changed
+4
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
35 | 27 | | |
36 | 28 | | |
37 | 29 | | |
38 | 30 | | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | 31 | | |
46 | 32 | | |
47 | 33 | | |
| |||
0 commit comments