-
Notifications
You must be signed in to change notification settings - Fork 232
Parallel fetching of available versions #2280
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
Conversation
8cad905
to
3a86142
Compare
This messes up the zones. That needs to be fixed to land this. |
the zones should work correctly now |
Fixes #2147 \o/ |
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.
Just some initial comments, I'll have more :)
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.
Minor risk of race condition in Retriever
... and minor concern about pre-fetching starting implicitly, but needing to be explicitly terminated.
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.
Thanks for the review!
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.
Just nits, this seems solid.
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.
@natebosch, if you have any more drive-by comments now is the time to make them, otherwise we'll land this :)
oh, I guess we'll also have to fix the travis tests.. but we'll land this soon :) |
lib/src/rate_limited_scheduler.dart
Outdated
if (_started.contains(task.jobId)) { | ||
return; | ||
} | ||
_started.add(task.jobId); |
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.
[nit] I usually prefer to skip the .contains
before a .add
on a Set.
if (!_started.add(task.jobId)) {
return;
}
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.
Done
} | ||
_started.add(task.jobId); | ||
|
||
Future<V> runJob() async { |
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.
Why do we need a separate function for this? Can we instead do
completer.complete(task.zone.runUnary(_runJob, task.jobId));
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.
It is to handle the case that _runJob throws sync exceptions
Added an explanatory comment
Implements rate-limited parallel fetching of version information when solving.
Also does speculative pre-fetching of version information of dependencies of the newest versions of each package.
In informal benchmarks of
pub get
for a package whose only direct dependency is package:test the resolution time goes from 7.8 seconds to 1.5 seconds.Also adds package:pedantic to our runtime dependencies