Descriptiondart2js: replace calls to codeUnitAt when index has favourable type
If the index is known to be a non-negative integer, only a simple
bounds check is required, so call a simpler version of codeUnitAt.
In a large app, about 60% of calls meet this condition.
Benchmarks do not show speedups, but that is because they are too
simple so global type inference can usually tell that the index is not
null, and often that it is always a non-negative integer, so the full version of codeUnitAt is optimized to look like the simple version. This does not happen in large apps.
BUG=
R=efortuna@google.com
Committed: https://github.com/dart-lang/sdk/commit/e933720d88b6491998c6e94fa13cb1d2b9e547eb
Patch Set 1 #Patch Set 2 : dartfmt #
Messages
Total messages: 6 (3 generated)
|