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

Terrible performance with Range iteration in -Onone

    XMLWordPrintable

    Details

      Description

      In this PR: https://github.com/apple/swift/pull/16099

      a benchmark was added to test Sequence.count(where: ) using Range:

      public func run_CountAlgoRange(_ N: Int) {
        for _ in 1...N {
          CheckResults((0..<10_000_000).count(where: \{ $0 & 65535 == 0 }) == 153)
        }
      }
      

       

      This turned out to have really bad performance characteristics on -Onone, so the benchmark was changed to use Array instead. We should investigate why.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              airspeedswift Ben Cohen
              Votes:
              2 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated: