[SR-4499] Iterating over elements from existential collections is super slow #47076
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
performance
standard library
Area: Standard library umbrella
Attachment: Download
Environment
Apple Swift version 3.1 (swiftlang-802.0.48 clang-802.0.38)
Target: x86_64-apple-macosx10.9
Additional Detail from JIRA
md5: cee46cb2c469d8962aa597f8a6f5f479
relates to:
Issue Description:
Sequence
andCollection
methods that return existential collections (AnySequence
andAnyCollections
) suffer from very slow performance iterating over the elements of underlying collection.Profiling the
benchmark/single-source/Suffix.swift
reveals thatAnySequence
correctly invokes thesuffix
implementation on the underlying collection, but the elements are vended using table dispatch from generic implementation on the protocol.The text was updated successfully, but these errors were encountered: