I am trying to retrieve the operations for the transactions of a given ledger.
First retrieve the transactions:
List<TransactionResponse> transactionResponses = this.server.horizonServer() .transactions() .forLedger(ledger) .execute() .getRecords();
Then retrieve the operations for each transactions:
List<OperationResponse> operationResponses = this.server.horizonServer() .operations() .forTransaction(transactionHash) .execute() .getRecords();
The second call is one order of magnitude slower than the first one, for example:
[PERFORMANCE] getTransactions (10): 34 ms [PERFORMANCE] getOperations (1): 274 ms [PERFORMANCE] getOperations (1): 353 ms [PERFORMANCE] getOperations (1): 294 ms [PERFORMANCE] getOperations (1): 207 ms [PERFORMANCE] getOperations (1): 307 ms [PERFORMANCE] getOperations (1): 309 ms [PERFORMANCE] getOperations (1): 301 ms [PERFORMANCE] getOperations (1): 304 ms [PERFORMANCE] getOperations (1): 293 ms [PERFORMANCE] getOperations (1): 295 ms
Is there a better way of doings this? We are running our own Stellar node with the official Stellar docker image, so everything (database, stellar-code and horizon) is running locally.