-
Notifications
You must be signed in to change notification settings - Fork 482
Allow join yielding by work and time simultaneously #22610
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -61,7 +61,10 @@ impl Default for LinearJoinSpec { | |
| fn default() -> Self { | ||
| Self { | ||
| implementation: LinearJoinImpl::Materialize, | ||
| yielding: YieldSpec::ByWork(1_000_000), | ||
| yielding: YieldSpec { | ||
| after_work: Some(1_000_000), | ||
| after_time: None, | ||
| }, | ||
| } | ||
| } | ||
| } | ||
|
|
@@ -88,18 +91,30 @@ impl LinearJoinSpec { | |
| V2: Data, | ||
| { | ||
| use LinearJoinImpl::*; | ||
| use YieldSpec::*; | ||
|
|
||
| match (self.implementation, self.yielding) { | ||
| (DifferentialDataflow, _) => { | ||
| match ( | ||
| self.implementation, | ||
| self.yielding.after_work, | ||
| self.yielding.after_time, | ||
| ) { | ||
| (DifferentialDataflow, _, _) => { | ||
| differential_dataflow::operators::JoinCore::join_core(arranged1, arranged2, result) | ||
| } | ||
| (Materialize, ByWork(limit)) => { | ||
| let yield_fn = move |_start, work| work >= limit; | ||
| (Materialize, Some(work_limit), Some(time_limit)) => { | ||
| let yield_fn = | ||
| move |start: Instant, work| work >= work_limit || start.elapsed() >= time_limit; | ||
| mz_join_core(arranged1, arranged2, shutdown_token, result, yield_fn) | ||
| } | ||
| (Materialize, Some(work_limit), None) => { | ||
| let yield_fn = move |_start, work| work >= work_limit; | ||
| mz_join_core(arranged1, arranged2, shutdown_token, result, yield_fn) | ||
| } | ||
| (Materialize, None, Some(time_limit)) => { | ||
| let yield_fn = move |start: Instant, _work| start.elapsed() >= time_limit; | ||
|
Comment on lines
+103
to
+113
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder what the overhead is to checking the option inside the closure. Calling
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So there are several things we could do:
(The "X for runtime performance" are just guesses, I don't really know either.) I went with (2) here because I really want to avoid regressing join performance, but I'm not too happy about readability. I'm not too worried about compile times, though maybe I should be :) |
||
| mz_join_core(arranged1, arranged2, shutdown_token, result, yield_fn) | ||
| } | ||
| (Materialize, ByTime(limit)) => { | ||
| let yield_fn = move |start: Instant, _work| start.elapsed() >= limit; | ||
| (Materialize, None, None) => { | ||
| let yield_fn = |_start, _work| false; | ||
| mz_join_core(arranged1, arranged2, shutdown_token, result, yield_fn) | ||
| } | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.