-
Notifications
You must be signed in to change notification settings - Fork 311
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
Make request to esplora in parallel #178
Conversation
.await?) | ||
let mut results = vec![]; | ||
for chunk in ChunksIterator::new(scripts.into_iter(), self.concurrency as usize) { | ||
let mut futs = FuturesOrdered::new(); |
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.
In theory, FuturesUnordered could squeeze performance a little bit, but I thought the increased code complexity wasn't worth the effort
@@ -52,7 +52,7 @@ | |||
//! | |||
//! # #[cfg(feature = "esplora")] | |||
//! # { | |||
//! let esplora_blockchain = EsploraBlockchain::new("..."); | |||
//! let esplora_blockchain = EsploraBlockchain::new("...", None); |
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.
Might be a good idea to just put "https://blockstream.info/testnet/api"
as first argument so people can copy-paste from the documentation.
I'm getting this error when I try to run the example command you provided:
It works if I update
Also seems like CI is stuck ... |
1ac39dd
to
c9079a7
Compare
Oh thanks, it looks I forgot the last push :) |
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.
Looks good to me. With cli update it compiles and I see a similar speedup.
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.
ACK c9079a7
At the moment the Esplora blockchain source, used in our playground, is making non-blocking requests but they are not parallelized.
This allows specifying the desired concurrency level when using this blockchain source.
I went for a default of 4, which is pretty conservative but library users and our repl could obviously use a custom value.
Test with
--esplora_concurrency X