-
Hey, I am right now on switching from web3.js to ethers.js, because I heard it is better. Previously I added all private keys via Everythings is just fine. But the routine I have written for web3 is making 5 calls in under 1 second. But with the ethers.js it takes around 4 seconds. I just don't know why ethers.js is just so slow. I am iterating over multiple wallets and do this routine and it is just a pain. I have researched everywhere and everythings regarding this topic. I tried the polling and pollingInterval settings of the JsonRpcProvider, or connected the wallet to the provider and returned this provider by getUncheckedSigner and passed this signer to the contract factory (that got generated by TypeChain). Has anyone a slight inkling what causes the extremely bad call perfomance of ethers.js??? P.S: I use Binance Smart Chain and the public available RPC service (non-websocket). |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 22 replies
-
I think I will just stick with web3.js for the moment, until I found out, what's the acutal problem with ethers.js. |
Beta Was this translation helpful? Give feedback.
-
Have you tried the JsonRpcBatchProvider? That will automatically lump all calls made within the same event loop into one call. That said, there is no reason ethers should be any slower than Web3.js, they both execute the exact same operations. I’ll have Provider support in the playground soon though, which will be useful for tracking which calls are going over the wire. |
Beta Was this translation helpful? Give feedback.
Have you tried the JsonRpcBatchProvider? That will automatically lump all calls made within the same event loop into one call.
That said, there is no reason ethers should be any slower than Web3.js, they both execute the exact same operations.
I’ll have Provider support in the playground soon though, which will be useful for tracking which calls are going over the wire.