feat: Resolve table relations in parallel#423
Merged
kodiakhq[bot] merged 2 commits intomainfrom Nov 23, 2022
Merged
Conversation
This reverts commit 655a04b.
yevgenypats
approved these changes
Nov 23, 2022
kodiakhq bot
pushed a commit
that referenced
this pull request
Nov 23, 2022
🤖 I have created a release *beep* *boop* --- ## [1.8.0](v1.7.0...v1.8.0) (2022-11-23) ### Features * Resolve table relations in parallel ([#423](#423)) ([ede04b7](ede04b7)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This changes the resolver for table relations to work concurrently, like parent tables. To do so safely and without the risk of deadlock, we instantiate one semaphore per depth level. (The size of the semaphore is decreased logarithmically for each depth.)
This change will only improve performance for tables with child relations.
To compare the performance before and after, I used the benchmarks in #415
Before
After
Analysis
This change focuses on the
BenchmarkTablesWithChildrenDefaultConcurrencycase. The change improvesresources/sfrom 545.9 to 30162, an improvement of about 55x. Memory and allocs are mostly the same.The small downward change in
resources/sin theBenchmarkDefaultConcurrencycase is likely due to the few additional allocs needed.Closes #358
Copy of #416 after it was reverted to schedule its release for another time.