Skip to content

Conversation

@halaei
Copy link
Contributor

@halaei halaei commented Mar 26, 2019

eachById() is a more efficient alternative to each(), just like chunkById() is to chunk().
I really liked to call each() but not being skip-take based makes its runtime complexity quadratic.

I also wish chunk() and each() would do id based by default. Because, in my opinion, they reserve better names but they do worse.

This PR is not complete yet. Regard it as just an idea.

@taylorotwell
Copy link
Member

Why is the PR not complete?

@halaei
Copy link
Contributor Author

halaei commented Mar 26, 2019

I have not tested it. Besides I find later that chunkById have different default values for column in the 2 builder classes. So maybe there should be 2 functions implemented in 2 classes instead of one in a trait.

@halaei
Copy link
Contributor Author

halaei commented Mar 26, 2019

@taylorotwell I force-pushed a commit. This now refactors chunkById() to prevent duplicate code both in chunkById() and eachById().
I think I have to close it anyway because of conflict. I will open another one.

@halaei halaei closed this Mar 26, 2019
@halaei halaei mentioned this pull request Mar 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants