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

SynchronizedQueue in SwiftPM has a Quadratic Dequeue Operation

    XMLWordPrintable

    Details

      Description

      SynchronizedQueue in the Basic library is using Array.removeFirst() to implement dequeueing which is O in the length of the array making the dequeue operation quadratic in the number of dequeues. It is not a huge bottleneck because it’s all array memory ops, but a (growable) ring buffer or a future Deque-like thing in Swift’s Standard Library would make for a better backing store.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              rwidmann Robert Widmann
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated: