Skip to content

Fast path Uint8List to _OneByteString conversion #41703

@askeksa-google

Description

@askeksa-google

The new UTF-8 decoder, when the input is found to contain only ASCII bytes, simply calls String.fromCharCodes on the desired range of the input Uint8List.

String.fromCharCodes performs a lot of type and range checks (which are redundant in this case) before it gets to the actual copying loop. Using a specialized conversion function without all the checks could significantly speed up the conversion of short strings.

Metadata

Metadata

Labels

area-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.type-performanceIssue relates to performance or code size

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions