Skip to content
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

reduce iterations in query and list by refactoring to use a transducer pattern #36

Closed
2 tasks done
TillaTheHun0 opened this issue Mar 9, 2023 · 3 comments · Fixed by #37
Closed
2 tasks done
Assignees
Labels
enhancement New feature or request

Comments

@TillaTheHun0
Copy link
Member

TillaTheHun0 commented Mar 9, 2023

We iterate over list of documents in this adapter quite a bit, and we usually do so sequentially -- "filter out these docs", "omit this field on each doc", "add this field". Each of these actions iterates through the array, which is fine for small lists of documents but could potentially have real impacts on performance with large lists of docs.

Instead, we should leverage transduce to reduce the number of times we iterate through a list to a single iteration, performing all transformations during that single iteration.

I should be able to refactor the code, and then run the unit tests to ensure nothing is broken

- [ ] #38

  • queryDocuments
  • listDocuments
@TillaTheHun0 TillaTheHun0 added the enhancement New feature or request label Mar 9, 2023
@TillaTheHun0 TillaTheHun0 self-assigned this Mar 9, 2023
@TillaTheHun0 TillaTheHun0 moved this to 📋 Backlog in Public Board Mar 9, 2023
@TillaTheHun0
Copy link
Member Author

I'll also use this opportunity to beef up the test coverage on this adapter. I'm noticing now that it's not where i'd like it to be.

@twilson63
Copy link
Contributor

Nice! Great work!

@TillaTheHun0 TillaTheHun0 changed the title reduce iterations in bulk, query and list by refactoring to use a transducer pattern reduce iterations in query and list by refactoring to use a transducer pattern Mar 13, 2023
@TillaTheHun0
Copy link
Member Author

TillaTheHun0 commented Mar 13, 2023

bulkDocuments has a lot of moving parts, so i'd like to do that separately. Covered in #38

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants