-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix stack overflow when diffing large collections on background threads #66
Fix stack overflow when diffing large collections on background threads #66
Conversation
Hey @tonyarnold, most of the checks seem to fail with |
It’s probably hardcoded into the CI workflows. Let me check that. |
Ok, rebase or merge the changes from |
Thanks for the quick fix Tony. Looking good now. |
Awesome - I’m away for a few days for New Years, and I won’t have a chance to look at this until I’m back. If you get time, could you run the performance tests linked in the read me against your changes? Otherwise, I’ll do it when I’m back. I’m aiming to hook those up to CI early next year. |
I ran the tests on my local machine and noticed a slight performance improvement for the I also had to make some minor adjustments to the performance suit because it didn't build out of the box with Swift 5, but I'll leave those to you if you want to hook it up to the CI anyway. |
Perfect - that's what I wanted to hear (that there was no large difference in performance on similar hardware). I'm going to merge this now - the CI changes can wait until my kids aren't underfoot and I have time to actually focus on doing it correctly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this contribution - you've improved the ergonomics of the DoublyLinkedList
type immensely 👍
Fixes #63.
Fixes #44.
As I mentioned over there, the issue is a stack overflow in large data sets due to recursive implementations of various methods operating on linked lists. I am unsure as to why this wasn't an issue on the main thread, but this fix should be an improvement nonetheless.
The recursive methods could easily be converted to be iterative or removed altogether by conforming the linked lists to
Sequence
and usingfor in
loops to iterate over them.I'm not sure if we should include the large, previously-failing test case as it takes quite a few seconds to run. It needs to be large enough to cause the stack overflow though.