-
Notifications
You must be signed in to change notification settings - Fork 373
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
Support batched JSONRPC requests #230
Comments
What do you think about using https://github.com/paritytech/jsonrpc/tree/master/tcp ? |
Thanks for the suggestion, will take a look :) |
Hi, is this feature being considered for future implementation? |
@vesparny if you're asking because you're experiencing performance issues it could be actually caused by inefficiency in some If you have the time, you could check the |
I believe that when Electrs is used over Tor (which is increasingly becoming the default), there is no improvement that will have a bigger impact on perceived performance. To illustrate this I created a custom build of Sparrow, loaded the same wallet twice and configured a connection to an ElectrumX server over Tor. One of the wallets used batched JSONRPC, the other did not. The difference was stark - the batched load completed in 7 secs while the non-batched in 68 seconds. Here are the loading logs - same wallet, same server: |
@craigraw I believe you're performing requests one-by-one, each issued only after previous completes, right? In that case it should be possible to send several requests in parallel to achieve better performance. Of course I do agree that batching is just better. If parallel requests are easy to implement for you it might be a useful temporary solution. |
Please take a look at #405 :) |
For the purposes of detecting and switching to batched JSON-RPC, can the 0.9.0 version be used (from the |
It's possible, but I would suggest sending a simple "batched" request to see if the server actually supports that :)
|
to my experience, you might accidentally crash an electrum server if you send unsupported request 😂 |
It was the case, but it should be resolved by #398 - i.e. electrs 0.8.10 shouldn't crash when getting an unsupported request :)
|
Tested on latest https://github.com/sparrowwallet/sparrow version - seems to be working as expected :) |
This is embarrassing to say, but adding the I'll fix this going forward of course, but I'd greatly appreciate it if the |
No worries, and thanks for letting me know :) |
Following #228
The text was updated successfully, but these errors were encountered: