Substrate has a macro, #[transactional]
, to ensure that any modifications to storage are not persisted in case of an error during execution.
I imagine there's some sort of caching done before committing any changes to the underlying database, and I was curious to know what kind of overhead was associated with annotating a function as #[transactional]
.
Maybe as a simple metric, if we consider two functions - one tagged with transactional and another not, how many more times could we execute the non-transactional function vs. the transactional function in the same amount of time?