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
Thanks for CombineExt, I've been using in my apps for a long time.
I recently ran into a performance issue with "Combine" .collect(.byTime). It starts a repeating timer that runs for the entire duration of the subscription. Depending on the time stride and how many of these you have it can really effect performance even when no items are getting published.
The problem that I was trying to solve with .collect(.byTime) is:
You have background work being performed and generating a sequence of results.
You have a UI that you want to update with those results (you want them all, not just last/first)
You want to batch process the results, it's too expensive to schedule each result separately on the main queue.
You only want to schedule a timer when items are passing through the publisher, don't want a repeating timer
If there's a good Combine or CombineExt way to do this I would love to know. Otherwise I have a publisher that does what I need here. The timing logic is quite simple, though I don't really understand the details of the surrounding "Combine" logic. It's mostly copied/pasted from CombineX.
Assuming this type of scheduler doesn't already existing I think the basic logic would be a good addition to CombineExt, though probably someone more in tune with combine internals should check and adapt the code to CombineExt.
The text was updated successfully, but these errors were encountered:
Thanks for CombineExt, I've been using in my apps for a long time.
I recently ran into a performance issue with "Combine"
.collect(.byTime)
. It starts a repeating timer that runs for the entire duration of the subscription. Depending on the time stride and how many of these you have it can really effect performance even when no items are getting published.The problem that I was trying to solve with
.collect(.byTime)
is:If there's a good Combine or CombineExt way to do this I would love to know. Otherwise I have a publisher that does what I need here. The timing logic is quite simple, though I don't really understand the details of the surrounding "Combine" logic. It's mostly copied/pasted from CombineX.
https://forums.swift.org/t/combines-collect-bytime-schedules-a-repeating-timer/57456
Assuming this type of scheduler doesn't already existing I think the basic logic would be a good addition to CombineExt, though probably someone more in tune with combine internals should check and adapt the code to CombineExt.
The text was updated successfully, but these errors were encountered: