mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 05:36:49 +00:00
c121db286a
* Check against raw `EfficientLengthIterable` instead of specifying its type parameter. Both checks are equivalent in this context as `EfficientLengthIterable` is an internal marker interface and an instance of `Iterable<T>` can never be an instance of `EfficientLengthIterable` but not an instance of `EfficientLengthIterable<T>`. VM compiler is currently not good enough to eliminate the `is` check if involves an uninstantiated type (see https://dartbug.com/53445). * Force inlining of `IndexedIterable` factory, `IndexedIterable.get iterator` and `IterableExtensions.indexed`. These changes significantly reduce overhead of for-in-indexed when compared to baseline classical loop: before these changes for-in-indexed is 13x slower than classical loop, after these changes it is only 2.8x slower. Performance comparison was using the following benchmark kernels: ```dart final list = List<int>.generate(10000, (i) => i); // For for-in-indexed var result = 0; for (var (i, e) in list.indexed) { result ^= (i & e); } // For classical loop var result = 0; for (var i = 0; i < list.length; i++) { result ^= (i & list[i]); } ``` CoreLibraryReviewExempt: No API changes, VM specific optimisations. Change-Id: Ic935a2aab2eda0837981184d872ee1eeef89ee7a Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/324461 Reviewed-by: Lasse Nielsen <lrn@google.com> Commit-Queue: Slava Egorov <vegorov@google.com> |
||
---|---|---|
.. | ||
async_cast.dart | ||
bytes_builder.dart | ||
cast.dart | ||
errors.dart | ||
internal.dart | ||
internal_sources.gni | ||
iterable.dart | ||
linked_list.dart | ||
list.dart | ||
lowering.dart | ||
patch.dart | ||
print.dart | ||
sort.dart | ||
symbol.dart |