Use less frequent write transactions in persistence task #12459
Labels
A-blockchain-tree
Related to sidechains, reorgs and pending blocks
A-db
Related to the database
C-enhancement
New feature or request
In the persistence task, we create a write transaction for every operation. Sometimes, we will be doing these persistence operations one after the other, and end up spending more time committing than we do actually writing. The write transaction can definitely be re-used in these cases. For example, it can take up to hundreds of ms, just to commit the safe block update.
We should only do this when we know we have more than one persistence action ready to process. This would mean we would have to:
The methods we use in the persistence task currently do not allow us to pass around a write transaction. We may have to refactor some methods inside of the persistence task, and may have to refactor some methods inside of providers. These should be separate changes, not done all at once.
The text was updated successfully, but these errors were encountered: