Uploaded image for project: 'Swift'
  1. Swift
  2. SR-4499

Iterating over elements from existential collections is super slow

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Medium
    • Resolution: Unresolved
    • Component/s: Standard Library
    • Labels:
    • Environment:

      Apple Swift version 3.1 (swiftlang-802.0.48 clang-802.0.38)
      Target: x86_64-apple-macosx10.9

      Description

      Sequence and Collection methods that return existential collections (AnySequence and AnyCollections) suffer from very slow performance iterating over the elements of underlying collection.

      Profiling the benchmark/single-source/Suffix.swift reveals that AnySequence correctly invokes the suffix implementation on the underlying collection, but the elements are vended using table dispatch from generic implementation on the protocol.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              palimondo Pavol Vaskovic
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated: