dart-sdk/sdk/lib
Ömer Sinan Ağacan 405a03909c [dart2wasm] Optimize UTF8 decoder when decoding a native array
Intercept all `Utf8Decoder.convert` calls to check the input type and
call the right UTF8 decoder function.

This currently only optimizes `U8List` parsing, and only the fastest
path where the input is an ASCII string. Follow-up CLs will optimize JS
typed array parsing by calling browser's UTF8 decoder and the slow paths
of non-ASCII and malformed buffers.

Results from an internal benchmark extracted from a real use case:

Before:

    Parse(RunTime):     330,500 us.

After:

    Parse(RunTime):     90,310 us.  (-72%)

dart2js -O4 results of the same benchmark:

    Parse(RunTime):     234,250 us.

Change-Id: I470697a9eb516e1e031e9b865ddb29e8f25569bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/331187
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Jackson Gardner <jacksongardner@google.com>
2023-10-23 18:36:52 +00:00
..
_http [io] Make _HttpDetachedIncoming fields private 2023-10-17 18:37:15 +00:00
_internal [dart2wasm] Optimize UTF8 decoder when decoding a native array 2023-10-23 18:36:52 +00:00
_wasm Expose some APIs for translating between wasm and JS interop types. 2023-09-27 21:34:38 +00:00
async Remove indirection in Timer example 2023-10-19 18:26:49 +00:00
cli [vm] Disable dart:cli waitFor by default 2023-09-14 10:08:29 +00:00
collection Unify splay tree iterators and interables constructor argument names. 2023-10-19 14:07:37 +00:00
convert Refer to unnamed constructors in doc comments with '.new' 2023-10-17 14:42:38 +00:00
core Fix bad link in updated docs. 2023-10-20 14:47:26 +00:00
developer [vm/compiler] Tag non-ffi force-optimized functions idempotent. 2023-08-18 18:27:58 +00:00
ffi [ffi/doc] Document the type requirements of native functions 2023-10-11 12:50:12 +00:00
html [dart:html] Fix incorrect parameter mention in drawImageScaledFromSource docs 2023-08-23 00:25:29 +00:00
indexed_db web_audio is not part sky_engine 2023-09-14 10:33:17 +00:00
internal Hide the existence of EfficientLengthIterable better. 2023-09-12 11:08:42 +00:00
io Remove deprecated APIs from dart_io_extensions.dart and add new is*Available RPCs. 2023-10-11 22:22:12 +00:00
isolate Refer to unnamed constructors in doc comments with '.new' 2023-10-17 14:42:38 +00:00
js
js_interop [dart:js_interop] Add/fix some js_interop helpers 2023-09-23 18:32:59 +00:00
js_interop_unsafe [dart:js_interop_unsafe] Rename extensions and make []/[]= take String properties 2023-09-12 23:11:55 +00:00
js_util
math
mirrors
svg web_audio is not part sky_engine 2023-09-14 10:33:17 +00:00
typed_data Reapply "[typed_data] Deprecate UnmodifiableUint8ListView and friends" 2023-10-23 18:14:33 +00:00
vmservice [vm] Pass offset and script uri for expression compilation 2023-10-12 10:22:38 +00:00
web_audio web_audio is not part sky_engine 2023-09-14 10:33:17 +00:00
web_gl web_audio is not part sky_engine 2023-09-14 10:33:17 +00:00
web_sql web_audio is not part sky_engine 2023-09-14 10:33:17 +00:00
analysis_options.yaml
libraries.json [dart2wasm] Make typed data implementation classes internally public 2023-10-18 06:40:49 +00:00
libraries.yaml [dart2wasm] Make typed data implementation classes internally public 2023-10-18 06:40:49 +00:00
PRESUBMIT.py
vmservice_libraries.json
vmservice_libraries.yaml