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
Optimize traverse #4498
Merged
Merged
Optimize traverse #4498
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
858cca4
Optimize List traverse for stack-safe Monads
TimWSpence 847df54
Optimize {List, Vector} traverse for StackSafeMonads
TimWSpence 878c4d0
Optimize {Queue, Map} traverse for StackSafeMonads
TimWSpence 9d86c98
Optimize Seq traverse for StackSafeMonads
TimWSpence c4bcba2
Optimize ArraySeq traverse for StackSafeMonads
TimWSpence c4c64ec
Optimize Chain traverse for StackSafeMonads
TimWSpence 1344a70
Add size hint to StackSafeMonad traverse
TimWSpence b6973dc
Optimize List traverseFilter for StackSafeMonads
TimWSpence f0648c4
Optimize {Seq, Queue, Vector, ArraySeq} traverseFilter for
TimWSpence dbccc8e
Optimize Chain filterTraverse for StackSafeMonads
TimWSpence fbf5ea5
Optimize List traverse_ for StackSafeMonads
TimWSpence 9f60d2b
Optimize Vector traverse_ for StackSafeMonads
TimWSpence f4fcf57
Optimize {Seq, ArraySeq, Chain, Queue} traverse_ for StackSafeMonads
TimWSpence d50bf83
Add extra laws tests so we test the multiple branches corresponding to
TimWSpence 5c5049f
Add benchmarks for traverse_ and for Chain
TimWSpence a1c9ff5
Use .void over .map(_ => ()) to give instances chance to optimize
TimWSpence 8cc742e
Experiment: use immutable data structures in optimized traverse
TimWSpence e3ae584
Experiment: use immutable List for optimized traverse
TimWSpence f95b087
Use applicative methods instead of flatMap
TimWSpence c5d90a6
Experiment: use Chain for aggregating our optimized traverse
TimWSpence 2d5f4d7
Implement optimized traverseFilter in terms of Chain as well
TimWSpence 702ab8b
Vector-based optimized traverse and traverseFilter in the same commit
TimWSpence b08196e
Retroactive attempt to establish a baseline including the new benchmarks
TimWSpence 92c91e4
Revert "Retroactive attempt to establish a baseline including the new…
TimWSpence 7d615dc
Merge remote-tracking branch 'upstream/main' into optimize-traverse
TimWSpence eebed5b
Use Applicative#unit to limit allocations
TimWSpence 803107d
More Applicative#unit to limit allocations
TimWSpence 0ee49e6
Remove mutable builder from Map traverse as its unlawful
TimWSpence 6529be7
Use Chain in `traverseDirectly`
valencik a62ce4c
Use `toList` in seq traverse, not vector
valencik 6cb787d
Merge pull request #2 from valencik/more-chain
TimWSpence File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
have you benchmarked
:+
onVector
vsChain
? I think Chain may be faster since it doesn't have to copy each internal block of items.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.
Yeah that's next on my todo list