ouroboros-network
ouroboros-network copied to clipboard
Implement a microbenchmark to isolate eras overhead
We need to measure what is the overhead that eras might add to the node, and obtain meaningful profiling information.
A possible way to do this is to use db-analyzer with this enhancement to measure the cost of:
- forecasting
- ticking the header state
- applying the header
- ticking the header ledger
- applying the block
using a hardfork block, and a single era block.
To this end, we could modify the process function so that it performs the measured computations twice: once include hardfork envelope blocks and once without the envelope. The HFC envelope is indeed very thin, and could be discarded for each of those 5 measurements except when the crossing the era boundary -- but 1) that is rare so we could just not compare the with-HFC and without-HFC for such blocks and 2) we could do something roughly approximate (tick up to the era boundary and translate before "discarding" the envelope).
A pre-requisite for solving this issue is to finish https://github.com/input-output-hk/ouroboros-network/pull/4014
According to https://github.com/input-output-hk/cardano-node/issues/4213#issuecomment-1240611179 getHeaderFields is high on the profile.
@deepfire @nfrisby, in light of the results observed in https://github.com/input-output-hk/ouroboros-network/pull/4014, it seems that Eras do not have any overhead. I wonder if we should close this one.