web3j
web3j copied to clipboard
about Flowable Performance problems
org.web3j.protocol.rx.JsonRpc2_0Rx#pendingTransactionFlowable When a large amount of data is traded, use flatMap will be delays.
**public Flowable<Transaction> pendingTransactionFlowable(long pollingInterval) {
return this.ethPendingTransactionHashFlowable(pollingInterval).flatMap((transactionHash) -> {
return this.web3j.ethGetTransactionByHash(transactionHash).flowable();
}).filter((ethTransaction) -> {
return ethTransaction.getTransaction().isPresent();
}).map((ethTransaction) -> {
return (Transaction)ethTransaction.getTransaction().get();
});
}**
hi @youzhang0413
Thanks for pointing this out, can you please provide more details on the size of the data sample and the time it takes to process? I presume the flatMap has been identified as a bottleneck after benchmarking with a profiler?