Improve performance of `validateCardanoTx`
koslambrou opened this issue · comments
koslambrou commented
Description
As a plutus-apps emulator user
I want an efficient version of validateCardanoTx
so that I waste as little time as possible when I run the emulator.
Technical details
After the first investigation of https://input-output.atlassian.net/browse/PLT-1026 (emulator performance regression following merge from next-node
to main
), validateCardanoTx takes 8% of the time of a whole plutus-use-cases run.
Here is an excerpt of the prof
file that illustrates the costs of the calls inside validateCardanoTx:
validateCardanoTx Ledger.Validation src/Ledger/Validation.hs:(278,1)-(282,63) 358902 2317 0.0 0.0 3.1 3.7
onCardanoTx Ledger.Tx src/Ledger/Tx.hs:(306,1)-(307,42) 358903 2317 0.0 0.0 3.1 3.7
hasValidationErrors Ledger.Validation src/Ledger/Validation.hs:(215,1)-(223,30) 365388 2252 0.0 0.0 3.1 3.7
applyTx Ledger.Validation src/Ledger/Validation.hs:(209,1)-(211,83) 365506 2252 0.0 0.0 1.1 1.2
getTxExUnitsWithLogs Ledger.Validation src/Ledger/Validation.hs:(285,1)-(298,97) 366140 863 0.0 0.0 0.7 1.0