Reputation: 81
We built our application based on cordapp-template-kotlin, and used the client folder infrastructure to provide rest services to a consumer who is a web application.
The services receive a list of data that serve as parameters to the flows. And we call the streams chained to each iteration in the data list. For example, the web provides a list of names, and with that list, we create accounts on corda. We want to improve the performance of our scenario as a whole. And one of the aspects that I thought could improve, would be to parallelize the flow calls. But when I paralleled the creation of accounts, for example, I did not have any performance gain. I would like to know why.
Creating accounts one by one in a linear way had the same performance of doing the creation in a parallel way. Is this the expected behavior or is there a problem in my development?
Upvotes: 1
Views: 180
Reputation: 1821
Corda Opensource doesn't have a multi-threaded flow state machine. Hence you won't be able to benefit from parallel flow execution on Corda Opensource.
A better approach for this with Corda Opensource would perhaps be batching of accounts with a single transaction on flow, rather than creating the accounts with multiple flow invocation.
With Corda Enterprise, however, you could benefit with multi-threaded flow state machine. But I would still recommend exploring the batching approach and find an optimal solution with maximum efficiency.
Upvotes: 1