You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adding an item to AsyncQueue<Serial> is linear in the number of pending queue items, thus adding n items to an AsyncQueue before any can execute is in O(n^2). This decision was made intentionally because the primary use case for AsyncQueue was to track pending LSP requests, of which we don’t expect to have too many pending requests at any given time.
But we should be able to resolve the quadratic issue of AsyncQueue<Serial> by making a new task only depend on the last item in the queue, which then transitively depends on all the previous items.
The text was updated successfully, but these errors were encountered:
Adding an item to `AsyncQueue` was linear in the number of pending queue items, thus adding n items to an `AsyncQueue` before any can execute is in O(n^2). This decision was made intentionally because the primary use case for `AsyncQueue` was to track pending LSP requests, of which we don’t expect to have too many pending requests at any given time.
While we can't fix the quadratic performance issue in general, we can resolve the quadratic issue of `AsyncQueue<Serial>` by making a new task only depend on the last item in the queue, which then transitively depends on all the previous items. `AsyncQueue<Serial>` are the queues that are most likely to contain many items.
Fixesswiftlang#1725
rdar://137886469
Adding an item to
AsyncQueue<Serial>
is linear in the number of pending queue items, thus adding n items to anAsyncQueue
before any can execute is in O(n^2). This decision was made intentionally because the primary use case forAsyncQueue
was to track pending LSP requests, of which we don’t expect to have too many pending requests at any given time.But we should be able to resolve the quadratic issue of
AsyncQueue<Serial>
by making a new task only depend on the last item in the queue, which then transitively depends on all the previous items.The text was updated successfully, but these errors were encountered: