-
Notifications
You must be signed in to change notification settings - Fork 25
Speed up the initial fetch #58
Speed up the initial fetch #58
Conversation
return section | ||
} | ||
|
||
Set(sections).forEach { |
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.
One liner .forEach { $0.sort() }
please 🙏
Clean up getMirror + Fixing tests
The idea is interesting, but i think you are abusing My solution would be: objects.forEach { getOrCreateSection($0).insert($0) }
sections.forEach { $0.sort() } What do you think? |
Oh, yes, I forgot about internal If not, I agree with you. |
@bronenos When a section runs out of objects, it is removed. So if a user only has 10k elements in one sections, that's the only one that is going to be sorted |
Okay, well, who will add the changes we discussed above? |
Whatever you prefer @bronenos , if you cannot do it, we'll do it whenever we can 👍 |
Well, ok, I will |
Rebase with master, there are new commits there conflicting Also, Add tests for tests for the new |
… into dev-stan-speed-up-initial-fetch
Done |
it("beforeAll") { | ||
section = Section<Task>(keyPath: "keyPath", sortDescriptors: sortDescriptors) | ||
section.insert(openTask) | ||
} |
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.
please use the beforeEach
closure.
If you need to clean between tests (and you should), use the afterEach
(apply to all tests ;) )
Hi @bronenos , There are cases where you are using the |
Merging it, will do a PR with the fixes commented above Thanks @bronenos |
Ok, thank you. |
If we have about 10k objects, we don't have to sort these objects 10k times.
So, lets sort each section just once after all relative objects have been inserted.