web3j icon indicating copy to clipboard operation
web3j copied to clipboard

about Flowable Performance problems

Open Alamu-Eth opened this issue 2 years ago • 1 comments

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();
    });
}**

Alamu-Eth avatar Oct 05 '22 05:10 Alamu-Eth

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?

mohamedelshami avatar Oct 20 '22 21:10 mohamedelshami